PHP errors full

Hello,

My php error log is full with these lines. Can this be resolved

[16-Jul-2020 07:08:33 Asia/Kolkata] PHP Deprecated: Non-static method PKPApplication::getRequest() should not be called statically in /home/japtronl/domains/japtronline.com/public_html/plugins/generic/customHeader/CustomHeaderPlugin.inc.php on line 112
[16-Jul-2020 07:14:32 Asia/Kolkata] PHP Deprecated: Non-static method PKPApplication::getRequest() should not be called statically in /home/japtronl/domains/japtronline.com/public_html/plugins/generic/customHeader/CustomHeaderPlugin.inc.php on line 112
[16-Jul-2020 07:25:49 Asia/Kolkata] PHP Deprecated: Non-static method PKPApplication::getRequest() should not be called statically in /home/japtronl/domains/japtronline.com/public_html/plugins/generic/customHeader/CustomHeaderPlugin.inc.php on line 112
[16-Jul-2020 07:26:01 Asia/Kolkata] PHP Deprecated: Non-static method PKPApplication::getRequest() should not be called statically in /home/japtronl/domains/japtronline.com/public_html/plugins/generic/customHeader/CustomHeaderPlugin.inc.php on line 112
[16-Jul-2020 07:26:22 Asia/Kolkata] PHP Deprecated: Non-static method PKPApplication::getRequest() should not be called statically in /home/japtronl/domains/japtronline.com/public_html/plugins/generic/customHeader/CustomHeaderPlugin.inc.php on line 112
[16-Jul-2020 07:26:36 Asia/Kolkata] PHP Deprecated: Non-static method PKPApplication::getRequest() should not be called statically in /home/japtronl/domains/japtronline.com/public_html/plugins/generic/customHeader/CustomHeaderPlugin.inc.php on line 112
[16-Jul-2020 07:34:23 Asia/Kolkata] PHP Deprecated: Non-static method PKPApplication::getRequest() should not be called statically in /home/japtronl/domains/japtronline.com/public_html/plugins/generic/customHeader/CustomHeaderPlugin.inc.php on line 112
[16-Jul-2020 07:35:37 Asia/Kolkata] PHP Deprecated: Non-static method PKPApplication::getRequest() should not be called statically in /home/japtronl/domains/japtronline.com/public_html/plugins/generic/customHeader/CustomHeaderPlugin.inc.php on line 112
[16-Jul-2020 07:37:18 Asia/Kolkata] PHP Deprecated: Non-static method PKPApplication::getRequest() should not be called statically in /home/japtronl/domains/japtronline.com/public_html/plugins/generic/customHeader/CustomHeaderPlugin.inc.php on line 112
[16-Jul-2020 07:37:30 Asia/Kolkata] PHP Deprecated: Non-static method PKPApplication::getRequest() should not be called statically in /home/japtronl/domains/japtronline.com/public_html/plugins/themes/bootstrap3/BootstrapThreeThemePlugin.inc.php on line 107
[16-Jul-2020 07:37:30 Asia/Kolkata] PHP Deprecated: Non-static method PKPApplication::getRequest() should not be called statically in /home/japtronl/domains/japtronline.com/public_html/plugins/themes/bootstrap3/BootstrapThreeThemePlugin.inc.php on line 129
[16-Jul-2020 07:37:32 Asia/Kolkata] PHP Deprecated: Non-static method PKPApplication::getRequest() should not be called statically in /home/japtronl/domains/japtronline.com/public_html/plugins/generic/customHeader/CustomHeaderPlugin.inc.php on line 112
[16-Jul-2020 07:37:53 Asia/Kolkata] ojs2: 404 Not Found

I am using OJS 3.2.0.3. Thanks in advance

Hi @joapreditor,

We resolve some of these warnings with each release. Upgrading to the latest will help.

Regards,
Alec Smecher
Public Knowledge Project Team

About this bunch of “PHP Deprecated” messages… I checked the file mentioned in those messages and found such code there:
$request = PKPApplication::getRequest();
I replaced it by such code:
$request = (new Application) -> getRequest();
and it solved the problem, no more “PHP Deprecated” messages in the log.
I don’t know if it is a good idea in general (from the code creators point of view) and I don’t know if it will work for you. So don’t use my words as a universal suggestion, but for me it solved the problem and brought no bad side effects, so I decided to register here to share my experience.

2 Likes

This topic was automatically closed after 33 hours. New replies are no longer allowed.