Deprecation Error Messages

I installed a new installation of OJS and then restored the journal files and database to this install and are getting the following errors. All the error warning switches are turned off so I don;t understand why they are still reporting the error. Thanks.

Server details:

OS platform Linux
PHP version 7.2.20
Apache version Apache/2
Database driver mysqli
Database server version 5.5.63-MariaDB

Deprecated : Non-static method PKPApplication::defineExposedConstant() should not be called statically in /home/radjr1/domains/ on line 545

Deprecated : Non-static method PKPApplication::getExposedConstants() should not be called statically in /home/radjr1/domains/ on line 513

Hi @radjr

What’s your error_reporting setting in your main php.ini file? Is there perhaps more than one php.ini file and the wrong one is being used?


Could you tell me where that would be? /usr/local/lib ?

You can find out by looking at the output of a call to phpinfo(), which you’d be able to see from the Admistration section of your journal, under extended system status. It should be right up at the top.



We have the following in the php.ini
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

Our previous server had error_reporting = E_ALL & ~E_DEPRECATED so I think there is something specific to php7 and this code.

Thoughts please? Thank you.

Hi all,

The error reporting is overridden in OJS 2.x in lib/pkp/classes/core/ in the constructor. Without modification, OJS 2.x is going to throw off warnings like this; if you’ve configured your display_errors setting so that errors/warnings are sent to the log rather than the browser, they will be cosmetic and can be ignored. In OJS 3.x, we’re working to fix these (and most have already been resolved). PHP has gradually shifted its requirements for what it considers “ideal” code over the years, and the OJS 2.x codebase is marginal with regards to PHP7.

Alec Smecher
Public Knowledge Project Team

In a previous support thread it was mentioned that version or higher supported php 7.x.

Is it possible that the release from the download link (in our case we used the to updater) does not have the changes to support php 7.x?

display_errors = off is in the Is there another inc file that controls behavior that we are missing? What changes do you suggest to lib/pkp/classes/core/ ?

Thank you.

Hi @radjr,

I’m not sure I’m following – the deprecation warnings are just warnings, not errors, and the system should continue to work regardless. Is that not the behavior you’re seeing?

Alec Smecher
Public Knowledge Project Team

The system is working but we are getting error messages to browser. Nothing turns them off to the browser and I can’t find where display_errors gets overridden. Thanks.

Hi @radjr,

display_errors is set either in your for OJS or in your system-wide php.ini configuration file. It should be turned off in both places. Unless your OJS has been modified, there are no other places where that configuration is changed.

Alec Smecher
Public Knowledge Project Team

I am still at a loss here. display_errors = Off is set in both the and the php.ini files!

Running phpinfo shows display_errors = On for the local value but off for the master value.

How could this be?

Problem solved. There was a directive in the index.php file with the following:
ini_set(‘display_errors’, E_ALL);

The server company INTERSERVER had a great tech who searched the entire server for this directive!
Thanks to Alec and all who helped!