# Upgrading cakephp version from 3.10 to 4.0x

**URL:** <https://discourse.cakephp.org/t/upgrading-cakephp-version-from-3-10-to-4-0x/11648>\
**Category:** Need Help\
**Tags:** release, help\
**Created:** [November 9, 2023, 4:30am UTC](https://discourse.cakephp.org/t/upgrading-cakephp-version-from-3-10-to-4-0x/11648 "2023-11-09T04:30:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sairaghuram.n](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sairaghuram.n](https://discourse.cakephp.org/u/sairaghuram.n)\
**Post date:** [November 9, 2023, 4:30am UTC](https://discourse.cakephp.org/t/upgrading-cakephp-version-from-3-10-to-4-0x/11648/1 "2023-11-09T04:30:51Z")

</div>

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.

 ![Screenshot 2023-11-09 at 9.48.04 AM](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/b/b6212789b3cf20de1050bfbd02944b282988e286.png)

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [November 9, 2023, 5:10am UTC](https://discourse.cakephp.org/t/upgrading-cakephp-version-from-3-10-to-4-0x/11648/2 "2023-11-09T05:10:00Z")

</div>

“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.

---

<div class="post-metadata">

**Author:** ![sairaghuram.n](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sairaghuram.n](https://discourse.cakephp.org/u/sairaghuram.n)\
**Post date:** [November 10, 2023, 8:36am UTC](https://discourse.cakephp.org/t/upgrading-cakephp-version-from-3-10-to-4-0x/11648/3 "2023-11-10T08:36:37Z")

</div>

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.

 ![Screenshot 2023-11-10 at 2.01.45 PM](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/5/5e88828ce1cd24a9ee75e68683242011c9d43abb.jpeg)

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [November 10, 2023, 9:09am UTC](https://discourse.cakephp.org/t/upgrading-cakephp-version-from-3-10-to-4-0x/11648/4 "2023-11-10T09:09:45Z")

</div>

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](https://github.com/cakephp/app/tree/4.0.4)  
If you are on CakePHP 4.1 you should check [Release CakePHP App 4.1.2 · cakephp/app · GitHub](https://github.com/cakephp/app/releases/tag/4.1.2)  
and so forth

You can see all tagged versions of the app template here: [Tags · cakephp/app · GitHub](https://github.com/cakephp/app/tags)

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

```auto
->add(new RoutingMiddleware())

```

to

```auto
->add(new RoutingMiddleware($this))

```

as you can see here: [https://github.com/cakephp/app/blob/4.0.4/src/Application.php#L85](https://github.com/cakephp/app/blob/4.0.4/src/Application.php#L85)
