[OJS] and PHP 7.4


Thanks to the support and guidance of moderators and users on this forum, we’ve handled a multitude of issues ranging from corrupted databases to a complete fresh install and migration of content. I have a problem that I’m not familiar with right now with our current OJS install utilizing PHP 7.4

On our hosted platform, we run OJS using PHP 7.3 without issue. However, as we’re upgrading a variety of platforms that now require PHP 7.4 to function, we moved our server to 7.4. For everyday operations, OJS exhibits no odd behavior. I’ve double-checked the PHP packages/extensions to ensure that it matches our 7.3 install completely. On the administration side for OJS on 7.4, I’m unable to run reports at all. I’ve gone back and forth between PHP 7.3 and 7.4 in order to run the reports, as it’s fairly simple to change it, but I’d like to move forward with PHP 7.4 fully. I don’t see anything reflected in the error logs as well so this is quite perplexing.

I’ve exported the extensions for our installed PHP configuration to ensure I wasn’t missing anything that would cause the reports not to run on OJS and everything that’s installed on 7.3 is also installed for 7.4. If anyone has any insight that I can look into, I would appreciate it!

Thank you.

Hi @charlescmyers,

Can you describe this in more detail? The page “Reports” doesn’t load or the error occurs when you are trying to generate a specific report or all of them?
What error code is displayed in the browser?
Are you familiar with browser’s developer tools? If yes, you can check there what request is failing, its status code, e.g.:

Request URL: .../stats/reports/report?pluginName=ViewReportPlugin
Statuc code: 500 Internal Server Error

Hi @Vitaliy

The page loads however when attempting to get the report generated, this is what is displayed:

Internal Server Error
Transferred441 B (0 B size)
Referrer Policystrict-origin-when-cross-origin

I can’t see any server side error logs, as the last recorded error message was thrown yesterday even though I attempted to load something just now.

I’m not sure what to look for with this so any assistance would be helpful.

Thank you.

EDIT: To clarify, the page that lists the reports loads up and when I attempt to click on a report to generate it, that’s the error message thrown regardless of what report I attempted to run.

Hmm, if it’s error 500, it should be something related in PHP error log. Can you check if you are looking in the right log file?


I checked in both the ojs/error_log file as well as the var/log/apache2 location and can’t find any reference to my error message in either the error_log file or the suphp_log file.

After running php --info | grep error I did see that’s it’s logging error messages but if it’s somewhere that’s not the default, I’ll have to look a little harder to find them.

It depends on how it’s configured in apache. On shared hosting, it’s better to ask the provider. Quite likely error log for PHP7.4 is stored separately.

The associated handler is here: pkp-lib/PKPStatsHandler.inc.php at aedcd5a19a3bea7aa9d759cad159536287ca4ede · pkp/pkp-lib · GitHub but without the message it’s hard to say what is happening


I’ll look into the WHM Root account (we run things off of a cPanel instance) and see if I can find the log itself. If I don’t make any headway, I might contact the vendor we worked with to setup the original instance of the server and see if they can help us find the log information.

Hi @Vitaliy and any other interested people,

Looking at our site, I noted the specific areas of the site that were inoperable while we were on 7.4.
On the administration menu, the Users, Articles, and Editorial Activity sections return the HTTP ERROR 500 when they’re accessed. The COUNTER reports work as well as the primary report we utilize, the PKP Usage Statistics Report.

So far, the closest PHP error I can find is the following:

[26-Jan-2022 19:43:29 UTC] PHP Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘d27451f62ee3f4382a48ced86d3a2fe9’ for key ‘sessions_pkey’ in //ojs/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:115
Stack trace:
#0 //ojs/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(115): PDOStatement->execute(NULL)
#1 //ojs/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(489): Doctrine\DBAL\Driver\PDOStatement->execute()
#2 //ojs/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(664): Illuminate\Database\Connection->Illuminate\Database{closure}(‘INSERT INTO ses…’, Array)
#3 //ojs/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate\Database\Connection->runQueryCallback(‘INSERT INTO ses…’, Array, Object(Clos in //ojs/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 671

EDIT: As I was writing this out, I was swapping to 7.4 to attempt to recreate the error message and it all works now.
I literally have 0 clue what happened, as I have no information as to what was causing the issue in the first place but it’s all working without any error messages so far. I’ll close this for now and if it happens again, I’ll link back to it and have the logs posted.

Thanks for your help @Vitaliy