PHP parse error with SimplePie plugin

I’m migrating an OJS 2.4.8 installation from a server that is shutting down and am getting an error 500 in the browser. (Note, I plan to upgrade to current supported versions once the migration is successful.)

Steps I took leading up to the issue

I installed 2.4.8-4 successfully, and was up and running.

I then imported the SQL db into the blank db originally created for the install and got the 500 error.

php log shows the following:

PHP Parse error: syntax error, unexpected ‘new’ (T_NEW) in /home/kblstudio/ojs.kblstudio.com/ojs-2.4.8-4/plugins/generic/externalFeed/simplepie/SimplePie.inc.php on line 737

I saw this github issue, which suggests the issue was resolved in 2.4.8-5…
https://github.com/pkp/pkp-lib/issues/5439

…so I followed the updating steps on this page (https://forum.pkp.sfu.ca/t/ojs-upgrade-from-2-4-2-0-to-2-4-8-5/80260) to update to 2.4.8-5.

I’m still getting the same error. Here is the relevant excerpt from the php log

[26-Jun-2024 17:31:43 America/Los_Angeles] ojs2 has produced an error
Message: WARNING: Parameter 2 to IndexHandler::index() expected to be a reference, value given
In file: /home/kblstudio/ojs.kblstudio.com/ojs-2.4.8-5/lib/pkp/classes/core/PKPRouter.inc.php
At line: 362
Stacktrace:
Server info:
OS: Linux
PHP Version: 7.2.34
Apache Version: N/A
DB Driver: mysqli
DB server version: 8.0.28-0ubuntu0.20.04.3
[26-Jun-2024 17:31:43 America/Los_Angeles] PHP Parse error: syntax error, unexpected ‘new’ (T_NEW) in /home/kblstudio/ojs.kblstudio.com/ojs-2.4.8-5/plugins/generic/externalFeed/simplepie/SimplePie.inc.php on line 737

What application are you using?
OJS 2.4.8-5

Additional information
Please add any screenshots, logs or other information we can use to investigate this problem.

Hi there @blonsway

Are the PHP and Mysql versions in the new server the same as in the old one?

Hi,
Thank you @hilongo for the follow-up.
No, they’re not. The old server was running PHP 5.4.16 (new server running 7.2.34) and the old server was running MariaDB 5.5.68, and the new one is running MySQL 8. Could these differences contribute to this error? And if so, how?

I think that version difference is to blame.

It seems to affect the externalFeed plugin. Maybe you can disable that plugin and see if the system works without it.

Hi @blonsway,

There was never a release of OJS 2.4.x that included a fix for externalFeed plugin broken in PHP7 · Issue #5439 · pkp/pkp-lib · GitHub; you’ll have to patch it manually by applying this change.

OJS 2.x is long obsolete, and you’re going to have increasing trouble running it in the future due to server dependencies needing to stay more current in order to stay secure. At this point even the 2.x to 3.x upgrade path has been removed from 3.4 and newer releases. I would strongly recommend prioritizing an upgrade to OJS 3.3.0 before it gets difficult to do so!

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Thank you! I was finally able to get to this again, and that patch worked. I thought it was in the 2.4.8-5 release; my bad.