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/ Stack trace: #0 /home/ceedghan/domains/ ObjectCollection->trigger() #1 /home/ceedghan/domains/ CakeEventManager->dispatch() #2 /home/ceedghan/domains/ Controller->startupProcess() #3 /home/ceedghan/domains/ ExceptionRenderer->_getController() #4 /home/ceedghan/domains/ ExceptionRenderer->__construct() #5 /home/ceedghan/domains/ ErrorHandler::handleException() #6 /home/ceedghan/domains/ ErrorHandler::handleFatalError() #7 /home/ceedghan/domains/ ErrorHandler::handleError() #8 /home/ceedghan/domains/ App::_checkFatalError() #9 [internal function]: App::shutdown() #10 {main} thrown in /home/ceedghan/domains/ 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