404 Page not displaying. Missing Controller

Hi everyone,

Can someone please help me with my issue. I am having a problem trying to access my 404 error pages. I am currently running Cakephp 5 on the server. When I try to access a URL that does not exist, instead of a custom 404 error page appearing, I get a “Missing Controller” page instead. The 404 error pages work on my localhost with debugkit off but it does not work on the server.

Any help is appreciated. Thanks

This image pops up when I access a page that does not exist. www.website.com/example

It is looking for ExampleController.php file.

Do you have the file in src/Controller/ExampleController.php ? If not, use the bake command to create one. See this tutorial.

When debugging is turned on, you get more verbose error pages, to help you diagnose the issue. Turn off debugging, and you should see the same error page as you get in production.

1 Like

Thanks for the responses.

However, sorry I should have been a bit more clearer. So the debugging error occurs on my domain where it is uploaded. I was under the assumption that debugging was not enabled on the domain when it is live. It should show a 404 error page like the one in the 2nd image.

You need to create the controller-file, as stated in the error message. It is all in the src/Controller folder.

This is something that’s entirely under your control, and it very much appears that debugging is, in fact, enabled there.