PHP Fatal error: Uncaught Error: Non-static method PKPApplication::getRequest()

[Sat Mar 27 17:42:22.459052 2021] [php:error] [pid 1261] [client ::1:34064] PHP Fatal error: Uncaught Error: Non-static method PKPApplication::getRequest() cannot be called statically in /var/www/html/plugins/generic/customHeader/CustomHeaderPlugin.inc.php:112\nStack trace:\n#0 /var/www/html/lib/pkp/classes/plugins/HookRegistry.inc.php(107): CustomHeaderPlugin->displayTemplateHook()\n#1 /var/www/html/lib/pkp/classes/template/PKPTemplateManager.inc.php(1168): HookRegistry::call()\n#2 /var/www/html/pages/index/IndexHandler.inc.php(67): PKPTemplateManager->display()\n#3 /var/www/html/lib/pkp/classes/core/PKPRouter.inc.php(395): IndexHandler->index()\n#4 /var/www/html/lib/pkp/classes/core/PKPPageRouter.inc.php(246): PKPRouter->_authorizeInitializeAndCallRequest()\n#5 /var/www/html/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPPageRouter->route()\n#6 /var/www/html/lib/pkp/classes/core/PKPApplication.inc.php(364): Dispatcher->dispatch()\n#7 /var/www/html/index.php(68): PKPApplication->execute()\n#8 {main}\n thrown in /var/www/html/plugins/generic/customHeader/CustomHeaderPlugin.inc.php on line 112

Hello

What php version that you are currently using?
Try changing the php version to 7.3 and try again this issue.

Dear Navotera

The PHP version is 8.

However, I had to wait the OJS 3.3.0-4 because the install process had a bug. When PKP fixed the bug I could install the, including PHP, APACHE and MySQL last version. My OJS instalation was fine until I try to install the CustomHeaderPlugin.inc.php plugging. It is very unconfortable to uninstall PHP last version to install 7.3 that you suggest. Please, could you fix the problem in CustomHeaderPlugin.inc.php and uptade the repository.

Thanks for reporting, @jcamposg. I have filed and fixed this at Fatal error in PHP 8 when getting request · Issue #20 · pkp/customHeader · GitHub. You can wait for a new release to be made of the plugin or apply this change to your code right away.

Dear Nathan…
Excellent support, thanks a lot!!!

1 Like