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
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.
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 ?
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.
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