Hey there! any question in your mind? Ask It Now!.

Popular Categories

How can we resolve Missing Controller in Cake PHP for New installation?

+3 votes
asked in Programming by mohit (190 points)

Installed cake php in my server in this root C:\localhost\cake I have the items_controller.php file. I am thinking for some reason the application does not know where the controller file is present. The complete error is :

Missing Controller Error: ItemsController could not be found. Error: Create the class ItemsController below in file: app\Controller\ItemsController.php

  class ItemsController extends AppController {


I have .htacess and index.php files in respective folder Can someone please help.

3 Answers

+1 vote
answered by jatin Expert (3,823 points)

Controller class names are plural, CamelCased, and end in Controller. So your controller name should be ItemsController.php not items_controller.php. See here for more info on Controllers.

class ItemsController extends AppController { 
    //class code here

you should create controler inside the app\Controller\ 

For more details about Controller here

+1 vote
answered by amit_pammu Expert (5,030 points)
which version you are using?

because it's a wrong syntax in cake 2.0
commented by mohit (190 points)
thanks for your interest , i am using this Version 2.3.9 can you tell me correct syntax?
commented by amit_pammu Expert (5,030 points)
which server are u using to local host WAMP or XAMP
+2 votes
answered by amit_pammu Expert (5,030 points)

try this..if u using xampp


 #LoadModule rewrite_module modules/mod_rewrite.so -> remove # from this.
 Restart Apache
commented by amit_pammu Expert (5,030 points)
what server are you using , xampp or wamp?
commented by pooja
i am using xampp
commented by amit_pammu Expert (5,030 points)
edited by amit_pammu
Hope you have followed the above steps , can you paste your controller code here , so i can understand better.
As per cake2.0+ your file name must be camelCased and plural as well.And file must be inside the controllers directory.

Related Questions

+6 votes
2 answers 1,999 views
+2 votes
1 answer 176 views
0 votes
1 answer 186 views
+2 votes
1 answer 227 views
+4 votes
1 answer 1,240 views
+1 vote
1 answer 257 views
+1 vote
2 answers 184 views

Not a Member yet?

Ask to Folks Login

My Account
322 Folks are online
0 members and 322 guest online
Your feedback is highly appreciated