CakePHP Controller could not be found

13,320

It looks like everything is correct as far as the code is concerned.

If/when everything else seems correct but you're still having problems, start looking for the oddballs. (The ones you rarely catch without having someone else look at your code).

Common oddball problems:

  • If you're using PHP short tags, are they turned on on the server?
  • Are there any spaces after you close your PHP tag? (shouldn't be closing PHP tags at all on class files)
  • If working remotely, was the file uploaded (and into the correct directory)
  • Does your file/folder have the correct permissions?
Share:
13,320
Ayo Ayokunle
Author by

Ayo Ayokunle

Updated on June 04, 2022

Comments

  • Ayo Ayokunle
    Ayo Ayokunle almost 2 years

    I am trying to create a simple Hello World program on cakephp before laying my hands on the popular forum application example but after going through the guidelines of one AndrewPerk on Youtube, I'm being told by the debugger to create "Create the class HellosController below in file: app\Controller\HellosController.php".

    I am familiar with CakePHP conventions and principles, that is why I am surprised at this error. I will provide my codes and the file path below:

    MODEL cake/app/Model/Hello.php

    <?
    class Hello extends AppModel {
        var $name='Hello';
    }
    ?>
    

    CONTROLLER cake/app/Controller/HellosController.php

    <?
    class HellosController extends AppController {
        var $name='Hellos';
        public function hello_world() {
    
        }
    }
    ?>
    

    VIEW cake/app/View/Hellos/hello_world.ctp

    <h3> Hello World </h3>
    <p> This is just to test cakephp functionalities</p>
    

    Based on the comments on the Youtube video, I was able to discover that many other people have the same error. I have tried to contact the author of the video but he isn't active on Twitter.

    I don't see any error here, can someone please help?