Ojs 2.4.8-4 is compatible with php 7.3?

Hi,

i’m trying upgrade my ojs 2.4.8-3 to 2.4.8-4 in php7.3. It is posible? Thanks,

Karol

My memory is that full PHP7 compatibility is present only in the GitHub stable and development branches for OJS 2.x, but reviewing the commit log, I can’t substantiate that. It looks like OJS 2.4.8-4 should be compatible. OJS 2.4.8-3 will not be. If you upgrade OJS 2.4.8-3 to OJS 2.4.8-4 under PHP5, you should then be able to upgrade to PHP7.

1 Like

Hi @ctgraham

We installed a clean OJS2.4.8-4 on PHP7.2 and the following issues are occurring:

  1. We see blank page on Journal Management Pages, Journal Setup Step 5 upon pressing ‘save’.

  2. Error logs exist: hundreds of errors are written to the server log files. Two type of errors have been identified.

Example:

PHP message: ojs2 has produced an error
Message: WARNING: Declaration of LucenePlugin::getManagementVerbs() should be compatible with GenericPlugin::getManagementVerbs($verbs = Array)
In file: /usr/www/users/xxxxx/plugins/generic/lucene/LucenePlugin.inc.php
At line: 1036
Stacktrace:
Server info:
OS: Linux
PHP Version: 7.2.17-1+0~20190412070953.20+jessie~1.gbp23a36d
Apache Version: N/A
DB Driver: mysqli
DB server version: 10.1.38-MariaDB-1~jessie


PHP message: ojs2 has produced an error
Message: WARNING: preg_match(): Delimiter must not be alphanumeric or backslash
In file: /usr/www/users/xxxxx/lib/pkp/classes/core/PKPString.inc.php
At line: 328
Stacktrace:
Server info:
OS: Linux
PHP Version: 7.2.17-1+0~20190412070953.20+jessie~1.gbp23a36d
Apache Version: N/A
DB Driver: mysqli
DB server version: 10.1.38-MariaDB-1~jessie

Any advice on how to move forward on this?

The PHP “WARNING” messages will not produce a blank white screen. You can suppress the PHP notice and warning and deprecated messages in your php configuration, if desired.

What error messages do you find which reference “Error” or “Fatal” in the Message?

Thanks for the guidance on the blank white screen - we are looking into suppressing the PHP notices and will check for ‘Error’ or ‘Fatal’ messages.

On OJS Journal Setup Step 5 (The Look) it generates a blank page when attempting to click “Save and continue” while running on PHP 7.2". Any thoughts on why this would occur?

There will be a corresponding “PHP Fatal” message in your log which will describe the failure. More helpful detail can be made available by turning on “show_stacktrace” in config.inc.php.

If you can provide the error message and stacktrace from the log, we’ll be able to identify and correct the issue.

Enabled the show_stacktrace but this did not provide additional details on the error when saving on Setup Step 5. Deployed a new blank OJS 2484 site, created a test journal and attempted to save on Setup Step 5 which generated the same 500 HTTP error.

Error occurs on a new blank OJS 2.4.8.4 site running on PHP 7.2, can you try and replicate on your side as to investigate the issue and provide guidance.

The error will be captured to your PHP error log. If you want to see the error in your browser, enable the config.inc.php setting display_errors.

Thanks for the guidance, herewith follows all the errors:

Deprecated: Non-static method PKPApplication::defineExposedConstant() should not be called statically in /usr/www/users/publiabycu/ojs2484blank/lib/pkp/classes/core/PKPApplication.inc.php on line 545 Deprecated: Non-static method PKPApplication::getExposedConstants() should not be called statically in /usr/www/users/publiabycu/ojs2484blank/lib/pkp/classes/core/PKPApplication.inc.php on line 513 ojs2 has produced an error Message: WARNING: ini_set(): Headers already sent. You cannot change the session module’s ini settings at this time In file: /usr/www/users/publiabycu/ojs2484blank/lib/pkp/classes/session/SessionManager.inc.php At line: 36 Stacktrace: Server info: OS: Linux PHP Version: 7.2.18-1+0~20190503101725.21+jessie~1.gbp101320 Apache Version: N/A DB Driver: mysqli DB server version: 10.1.39-MariaDB-1~jessie
ojs2 has produced an error Message: WARNING: ini_set(): Headers already sent. You cannot change the session module’s ini settings at this time In file: /usr/www/users/publiabycu/ojs2484blank/lib/pkp/classes/session/SessionManager.inc.php At line: 37 Stacktrace: Server info: OS: Linux PHP Version: 7.2.18-1+0~20190503101725.21+jessie~1.gbp101320 Apache Version: N/A DB Driver: mysqli DB server version: 10.1.39-MariaDB-1~jessie
ojs2 has produced an error Message: WARNING: ini_set(): Headers already sent. You cannot change the session module’s ini settings at this time In file: /usr/www/users/publiabycu/ojs2484blank/lib/pkp/classes/session/SessionManager.inc.php At line: 38 Stacktrace: Server info: OS: Linux PHP Version: 7.2.18-1+0~20190503101725.21+jessie~1.gbp101320 Apache Version: N/A DB Driver: mysqli DB server version: 10.1.39-MariaDB-1~jessie
ojs2 has produced an error Message: WARNING: ini_set(): Headers already sent. You cannot change the session module’s ini settings at this time In file: /usr/www/users/publiabycu/ojs2484blank/lib/pkp/classes/session/SessionManager.inc.php At line: 39 Stacktrace: Server info: OS: Linux PHP Version: 7.2.18-1+0~20190503101725.21+jessie~1.gbp101320 Apache Version: N/A DB Driver: mysqli DB server version: 10.1.39-MariaDB-1~jessie
ojs2 has produced an error Message: WARNING: ini_set(): Headers already sent. You cannot change the session module’s ini settings at this time In file: /usr/www/users/publiabycu/ojs2484blank/lib/pkp/classes/session/SessionManager.inc.php At line: 40 Stacktrace: Server info: OS: Linux PHP Version: 7.2.18-1+0~20190503101725.21+jessie~1.gbp101320 Apache Version: N/A DB Driver: mysqli DB server version: 10.1.39-MariaDB-1~jessie
ojs2 has produced an error Message: WARNING: ini_set(): Headers already sent. You cannot change the session module’s ini settings at this time In file: /usr/www/users/publiabycu/ojs2484blank/lib/pkp/classes/session/SessionManager.inc.php At line: 41 Stacktrace: Server info: OS: Linux PHP Version: 7.2.18-1+0~20190503101725.21+jessie~1.gbp101320 Apache Version: N/A DB Driver: mysqli DB server version: 10.1.39-MariaDB-1~jessie
ojs2 has produced an error Message: WARNING: ini_set(): Headers already sent. You cannot change the session module’s ini settings at this time In file: /usr/www/users/publiabycu/ojs2484blank/lib/pkp/classes/session/SessionManager.inc.php At line: 42 Stacktrace: Server info: OS: Linux PHP Version: 7.2.18-1+0~20190503101725.21+jessie~1.gbp101320 Apache Version: N/A DB Driver: mysqli DB server version: 10.1.39-MariaDB-1~jessie
ojs2 has produced an error Message: WARNING: ini_set(): Headers already sent. You cannot change the session module’s ini settings at this time In file: /usr/www/users/publiabycu/ojs2484blank/lib/pkp/classes/session/SessionManager.inc.php At line: 43 Stacktrace: Server info: OS: Linux PHP Version: 7.2.18-1+0~20190503101725.21+jessie~1.gbp101320 Apache Version: N/A DB Driver: mysqli DB server version: 10.1.39-MariaDB-1~jessie
ojs2 has produced an error Message: WARNING: ini_set(): Headers already sent. You cannot change the session module’s ini settings at this time In file: /usr/www/users/publiabycu/ojs2484blank/lib/pkp/classes/session/SessionManager.inc.php At line: 44 Stacktrace: Server info: OS: Linux PHP Version: 7.2.18-1+0~20190503101725.21+jessie~1.gbp101320 Apache Version: N/A DB Driver: mysqli DB server version: 10.1.39-MariaDB-1~jessie
ojs2 has produced an error Message: WARNING: ini_set(): Headers already sent. You cannot change the session module’s ini settings at this time In file: /usr/www/users/publiabycu/ojs2484blank/lib/pkp/classes/session/SessionManager.inc.php At line: 46 Stacktrace: Server info: OS: Linux PHP Version: 7.2.18-1+0~20190503101725.21+jessie~1.gbp101320 Apache Version: N/A DB Driver: mysqli DB server version: 10.1.39-MariaDB-1~jessie
ojs2 has produced an error Message: WARNING: session_set_save_handler(): Cannot change save handler when headers already sent In file: /usr/www/users/publiabycu/ojs2484blank/lib/pkp/classes/session/SessionManager.inc.php At line: 54 Stacktrace: Server info: OS: Linux PHP Version: 7.2.18-1+0~20190503101725.21+jessie~1.gbp101320 Apache Version: N/A DB Driver: mysqli DB server version: 10.1.39-MariaDB-1~jessie
ojs2 has produced an error Message: WARNING: session_start(): Cannot start session when headers already sent In file: /usr/www/users/publiabycu/ojs2484blank/lib/pkp/classes/session/SessionManager.inc.php At line: 59 Stacktrace: Server info: OS: Linux PHP Version: 7.2.18-1+0~20190503101725.21+jessie~1.gbp101320 Apache Version: N/A DB Driver: mysqli DB server version: 10.1.39-MariaDB-1~jessie
DB Error: Duplicate entry ‘’ for key ‘sessions_pkey’

There are several cases where the split() function was used in 2.4.8-4:

https://github.com/pkp/ojs/commit/7ca3a84c1f269e101a71804998ad1145c6391ded

https://github.com/pkp/ojs/commit/c3383388650a0f3d845e597d030ef6d6041516c3

You can manually patch these changes, or checkout the branch stable-2_4_8 from git, or look for an upcoming release of 2.4.8-5 or 2.4.9.

Hi @ctgraham

Further to the above fixes, which worked well we have been notified of other repeating errors being logged to the server - do you have any guidance towards resolving them?

(48 entries)
WARNING: Declaration of ArticleFileManager::readFile($fileId, $revision = NULL, $output = false) should be compatible with & FileManager::readFile($filePath, $output = false)\n In file: /usr/www/users/peanuts/classes/file/ArticleFileManager.inc.php\n At line: 678\n Stacktrace: \n Server info:\n OS: Linux\n PHP Version: 7.2.21-1+0~20190807.25+debian8~1.gbp935ebf\n Apache Version: N/A\n DB Driver: mysqli\n DB server version: 10.1.41-MariaDB-1~jessie\n

(50 entries)
WARNING: Declaration of ArticleHandler::validate(&$request, $articleId, $galleyId = NULL) should be compatible with PKPHandler::validate($requiredContexts = NULL, $request = NULL)\n In file: /usr/www/users/peanuts/pages/article/ArticleHandler.inc.php\n At line: 23\n Stacktrace: \n Server info:\n OS: Linux\n PHP Version: 7.2.21-1+0~20190807.25+debian8~1.gbp935ebf\n Apache Version: N/A\n DB Driver: mysqli\n DB server version: 10.1.41-MariaDB-1~jessie\nPHP message: ojs2 has produced an error

(48 entries)
WARNING: Declaration of InstitutionalSubscription::isValid($domain, $IP, $check = SUBSCRIPTION_DATE_BOTH, $checkDate = NULL) should be compatible with Subscription::isValid($check = SUBSCRIPTION_DATE_BOTH, $checkDate = NULL)\n In file: /usr/www/users/peanuts/classes/subscription/InstitutionalSubscription.inc.php\n At line: 0\n Stacktrace: \n Server info:\n OS: Linux\n PHP Version: 7.2.21-1+0~20190807.25+debian8~1.gbp935ebf\n Apache Version: N/A\n DB Driver: mysqli\n DB server version: 10.1.41-MariaDB-1~jessie\nPHP message: ojs2 has produced an error

(47 entries)
WARNING: Declaration of DOIPubIdPlugin::getPubId($pubObject, $preview = false) should be compatible with PubIdPlugin::getPubId(&$pubObject, $preview = false)\n In file: /usr/www/users/peanuts/plugins/pubIds/doi/DOIPubIdPlugin.inc.php\n At line: 19\n Stacktrace: \n Server info:\n OS: Linux\n PHP Version: 7.2.21-1+0~20190807.25+debian8~1.gbp935ebf\n Apache Version: N/A\n DB Driver: mysqli\n DB server version: 10.1.41-MariaDB-1~jessie\n’

These errors should not prevent OJS from running, but in my case the log files became enormous (several gigabytes). The fix is to add two additional classes of PHP errors in /lib/pkp/classes/core/PKPApplication.inc.php, after line 52:

if (defined('E_WARNING')) $errorReportingLevel &= ~E_WARNING;
if (defined('E_NOTICE')) $errorReportingLevel &= ~E_NOTICE;

See the solution by @Jeffery_Triggs in post PHP 7 warnings filling up error log after upgrade to 2.4.8.4 for more info.

Cheers, Ales

2 Likes