Deprecation Error Messages

I installed a new 2.4.8.5 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/wmpllc.org/public_html/ojs/lib/pkp/classes/core/PKPApplication.inc.php on line 545

Deprecated : Non-static method PKPApplication::getExposedConstants() should not be called statically in /home/radjr1/domains/wmpllc.org/public_html/ojs/lib/pkp/classes/core/PKPApplication.inc.php 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?

Cheers,
Jason

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.

Cheers,
Jason

Thanks,

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/PKPApplication.inc.php 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.

Regards,
Alec Smecher
Public Knowledge Project Team

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

Is it possible that the release from the download link https://pkp.sfu.ca/ojs/ojs_download/ (in our case we used the 2.4.8.1 to 2.4.8.5 updater) does not have the changes to support php 7.x?

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

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?

Regards,
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 config.inc.php 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.

Regards,
Alec Smecher
Public Knowledge Project Team

I am still at a loss here. display_errors = Off is set in both the config.inc.php 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!