Error - Include(Controller.php): Failed To Open Stream: No Such File Or Directory (D:\yii\framework\yiibase.php:421)


I am new to yii and just finished generating controllers and models for some tables using gii. As suggested in the documentation when I try to run it as suggested i.e. localhost/index.php/country/ i get the following error :

include(Controller.php): failed to open stream: No such file or directory


Stack trace:

#0 D:\connect\controllers\CountryController.php(4): spl_autoload_call()

#1 D:\yii\framework\web\CWebApplication.php(354): require()

#2 D:\yii\framework\web\CWebApplication.php(276):


#3 D:\yii\framework\web\CWebApplication.php(141):


#4 D:\yii\framework\base\CApplication.php(169):


#5 D:\connect\index.php(14): CWebApplication->run()


Any help on this will be appreciated.

Thanks in advance

Check that you have a file named Controller.php in components/ folder. If it’s there check if it has been imported by looking at config/main.php and you should have something like:





Thanks. This file was missing. Copied it into the relevant directory and it worked!!!