Hi Guys, I have an application currently running on CakePHP version 3.10 and PHP version 7.4. The application is running using a Docker file. Now I have tried to upgrade the CakePHP version to the latest 5.0x. To do that, I am doing it step by step. But while I am trying to upgrade to CakePHP version 4.0, the server is not turning up, and it won’t show any errors either. I have followed all the steps that were declared in the CakePHP version 4 official document. I have attached an image of the local host as it was opening. Please help me to upgrade the application to the CakePHP version.
“Error 500” is an extremely generic error, there’s no possible way we can tell you anything about what’s wrong from that. There will be more details about the error in your Apache or Cake logs, and you should also enable debugging in your dev app configuration, so that error messages go to your browser instead of giving you a generic message like this.
Hey Zuluru, I hope you are doing well. As per the information, I tried enabling debugging. Now I can see the errors are coming mostly from the vendor files. Please, could you help me with that? I have attached a screenshot of the issue. If possible… Please let me know about the clear process of upgrading to the latest version of CakePHP from 3.10.
Everytime you upgrade to a new minor or major you should make sure your app template is up2date with what is present in cakephp/app
So if you are now on CakePHP 4.0 you should check GitHub - cakephp/app at 4.0.4
If you are on CakePHP 4.1 you should check Release CakePHP App 4.1.2 · cakephp/app · GitHub
and so forth
You can see all tagged versions of the app template here: Tags · cakephp/app · GitHub
In your specific case the error is pretty clear as it states that the RoutingMiddleware needs 1 parameter to be passed down. So you need to change
->add(new RoutingMiddleware())
to
->add(new RoutingMiddleware($this))
as you can see here: https://github.com/cakephp/app/blob/4.0.4/src/Application.php#L85