OJS upgrade error

Hello,

I am trying to upgrade OJS from 3.0.2.0 to 3.1.2-1 with PHP 7.3.10. When performing upgrade I get following error:

PHP Parse error: syntax error, unexpected ‘[’ in…/lib/pkp/lib/vendor/illuminate/support/helpers.php on line 404

Any idea what is wrong?

Best regards, Primož

Hi @primozs,

Double-check your PHP version (e.g. by running php --version, if you’re using the PHP command line to try the upgrade). I suspect you’re actually running with something much older than 7.3.10.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

That was exactly the case, thank you very much.
But I don’t understand it, will investigate further. The info.php return 7.3.10, while php --version returns 5.3.29.

Best regards, Primož

Hi @primozs,

You’re checking phpinfo via the web, correct? Many servers use different PHP binaries for processing web-based requests vs. the command-line tool. I suspect if you try php -i on the command line that you’ll see the same 5.3.29 version.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

You are right. The problem was the hosting offers a possibility to select/change the PHP version per domain directory. And that is correctly set to 7.3. But this setting doesn’t apply to the CLI even in the same directory. But since the upgrade is not so big, I managed to do it via WEB.

Thank you very much for help.

Best regards, Primož