Required php version for 2.4.8.1 is >=5.3 because of anonymous functions in CrossRefExportPlugin.inc.php

When you try to run the cli upgrade tool (php upgrade.php upgrade) in 2.4.8.x and your php version is <5.3 you get an error:
Parse error: syntax error, unexpected T_FUNCTION in /var/www/localhost/htdocs/ojs-2.3.4/plugins/importexport/crossref/CrossRefExportPlugin.inc.php on line 210

The reason is that CrossRefExportPlugin.inc.php uses anonymous functions in a few places. Unfortunately, anonymous functions became available in php>=5.3

(I suspect that you will get similar errors when running a freshly installed OJS 2.4.8.x with php <5.3.)

So, please either change the php requirement in README file, or (preferably) change the relevant code… In the latter case, anonymous functions may be used in other parts of the code, so changes may be needed in other files too.

Thanks in advance,
Theodoropoulos Theodoros

This is a known bug. See:

A fix is available:
https://github.com/pkp/pkp-lib/issues/1749

Thanks for your instant reply! Indeed the fix is working as expected.

(prior to opening a new thread I did a search in the forum but I didn’t find the one you’re mentioning)

People with old php version reading this post will probably face an issue with the Counter plugin too, so please note also the following patch: