Yii框架:未找到致命错误控制器类

时间:2016-03-28 15:20:31

标签: yii controller yii-components

我有一个现有的项目。我已经在我的个人电脑上配置了这个项目,但是当我尝试在其他电脑上配置它时,我收到了以下错误。

( ! ) Fatal error: Class 'Controller' not found in C:\wamp\www\gal\protected\controllers\SiteController.php on line 3
Call Stack
#   Time    Memory  Function    Location
1   0.0000  131192  {main}( )   ...\index.php:0
2   0.0110  1167128 CApplication->run( )    ...\index.php:15
3   0.0110  1167752 CWebApplication->processRequest( )  ...\CApplication.php:185
4   0.0120  1295328 CWebApplication->runController( )   ...\CWebApplication.php:141
5   0.0120  1295496 CWebApplication->createController( )    ...\CWebApplication.php:276
6   0.0120  1334120 require( 'C:\wamp\www\gal\protected\controllers\LoginController.php' )  ...\CWebApplication.php:354
7   0.0120  1334280 spl_autoload_call ( )   ...\CWebApplication.php:8
8   0.0120  1334304 YiiBase::autoload( )    ...\CWebApplication.php:8
9   0.0120  1335464 CApplication->handleError( )    ...\CWebApplication.php:442
10  0.0160  1800752 CErrorHandler->handle( )    ...\CApplication.php:834
11  0.0160  1792904 CErrorHandler->handleError( )   ...\CErrorHandler.php:133
12  0.0160  1801992 CErrorHandler->renderError( )   ...\CErrorHandler.php:296
13  0.0160  1802024 CWebApplication->runController( )   ...\CErrorHandler.php:368
14  0.0160  1802024 CWebApplication->createController( )    ...\CWebApplication.php:276
15  0.0160  1819904 require( 'C:\wamp\www\gal\protected\controllers\SiteController.php' )   ...\CWebApplication.php:354

我的文件夹结构是

myproject
  protected
    command
    components
    config
    controllers
    data
    extensions
    messages
    migrations
    models
    modules
    test
    views


Main.php has 
'import'=>array(
  'application.models.*',

  'application.components.*'

),

此致 阿肖克

1 个答案:

答案 0 :(得分:2)

检查"控制器"严格错误。

例如在我的案例中帮助纠正了

public function beforeRender()

public function beforeRender($view)

或关闭STRICT的error_reporting并检查它是否有帮助,那么您肯定知道这是类似的问题。