Cake php 7.4 error

I uploaded a website running on php 7.4 version but this is the error i get

Fatal error : Uncaught Error: Unknown named parameter $subject in /home/ceedghan/domains/ceedghana.org/public_html/admin/lib/Cake/Utility/ObjectCollection.php:129 Stack trace: #0 /home/ceedghan/domains/ceedghana.org/public_html/admin/lib/Cake/Event/CakeEventManager.php(244): ObjectCollection->trigger() #1 /home/ceedghan/domains/ceedghana.org/public_html/admin/lib/Cake/Controller/Controller.php(682): CakeEventManager->dispatch() #2 /home/ceedghan/domains/ceedghana.org/public_html/admin/lib/Cake/Error/ExceptionRenderer.php(158): Controller->startupProcess() #3 /home/ceedghan/domains/ceedghana.org/public_html/admin/lib/Cake/Error/ExceptionRenderer.php(95): ExceptionRenderer->_getController() #4 /home/ceedghan/domains/ceedghana.org/public_html/admin/lib/Cake/Error/ErrorHandler.php(126): ExceptionRenderer->__construct() #5 /home/ceedghan/domains/ceedghana.org/public_html/admin/lib/Cake/Error/ErrorHandler.php(269): ErrorHandler::handleException() #6 /home/ceedghan/domains/ceedghana.org/public_html/admin/lib/Cake/Error/ErrorHandler.php(212): ErrorHandler::handleFatalError() #7 /home/ceedghan/domains/ceedghana.org/public_html/admin/lib/Cake/Core/App.php(970): ErrorHandler::handleError() #8 /home/ceedghan/domains/ceedghana.org/public_html/admin/lib/Cake/Core/App.php(943): App::_checkFatalError() #9 [internal function]: App::shutdown() #10 {main} thrown in /home/ceedghan/domains/ceedghana.org/public_html/admin/lib/Cake/Utility/ObjectCollection.php on line 129

This seems to be a very old CakePHP 2 application.
See php-8.0-compat: fix "Error: Unknown named parameter $subject" · cakephp/cakephp@d201312 · GitHub for the explenation why this error happens.

The solution for you is to update to at least CakePHP 2.10.23 because in there the fix is present for your problem.

But I have to remind you (If you haven’t already noticed) - CakePHP 2 is EOL since June 15, 2021

Even CakePHP 3 EOL is coming nearer which is December 15, 2022

So I would highly recommend you to try a rework of your app in the current latest CakePHP 4.4 to be up2date

1 Like

Well noted but with the change of the lib folder to the current version should fix the issue. It works perfectly on my local. But i get that error when i upload it online

It would be good to tell us that error then… Can’t really tell that out of the blue