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
2,449 views
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

<?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

 

xampp/apache/conf/httpd.conf
 #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
1 answer 238 views
+6 votes
2 answers 1,556 views
+2 votes
1 answer 139 views
0 votes
1 answer 105 views
+2 votes
1 answer 101 views
asked in Programming by krish Expert (6,310 points)
+4 votes
1 answer 918 views
+1 vote
1 answer 182 views
+1 vote
2 answers 78 views
+4 votes
5 answers 718 views
0 votes
1 answer 9,844 views

Not a Member yet?

Ask to Folks Login

My Account
607 Folks are online
87 members and 520 guest online
Your feedback is highly appreciated