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

Hi,

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

(D:\yii\framework\YiiBase.php:421)

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):

CWebApplication->createController()

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

CWebApplication->runController()

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

CWebApplication->processRequest()

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

REQUEST_URI=/index.php/country/

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:




'import'=>array(

        ........

        'application.components.*',

    ),



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