1

带有消息“未定义属性“CConsoleApplication.defaultController”的异常“CException”。在 ..\yiisoft\yii\framework\base\CComponent.php:173

有人坚持这个错误吗?解决方案是什么?

感谢您的回复。

带有消息“未定义属性“CConsoleApplication.defaultController”的异常“CException”。在 C:\xampp\htdocs\projects...\vend 或\yiisoft\yii\framework\base\CComponent.php:173 堆栈跟踪:

0 C:\xampp\htdocs\projects...\vendor\yiisoft\yii\framework\base\CModule.php(513): CComponent->__set('defaultControll...', 'users/user')

1 C:\xampp\htdocs\projects...\vendor\yiisoft\yii\framework\base\CApplication.php(150): CModule->configure(Array)

2 C:\xampp\htdocs\projects...\vendor\yiisoft\yii\framework\YiiBase.php(125): CApplication->__construct('C:\xampp\htdocs...')

3 C:\xampp\htdocs\projects...\vendor\yiisoft\yii\framework\YiiBase.php(113): YiiBase::createApplication('CConsoleApplica...', 'C:\xampp\htdocs... ')

4 C:\xampp\htdocs\projects...\vendor\yiisoft\yii\framework\yiic.php(23): YiiBase::createConsoleApplication('C:\xampp\htdocs...')

5 C:\xampp\htdocs\projects...\app\yiic.php(7):require_on

此外,如果我删除 defaultController 我会收到此错误:

带有消息“CConsoleApplication”的异常“CException”及其行为没有名为“getSession”的方法或闭包。在 C:\xampp\htdocs\projects...\vendor\yiisoft\yii\framework\base\CComponent.php:266 堆栈跟踪:

0 C:\xampp\htdocs\projects...\vendor\yiisoft\yii\framework\web\auth\CWebUser.php(193): CComponent>__call('getSession', Array)

1 C:\xampp\htdocs\projects...vendor\yiisoft\yii\framework\web\auth\CWebUser.php(193): CConsoleApplication->getSession()

2 C:\xampp\htdocs\projects...\vendor\yiisoft\yii\framework\base\CModule.php(387): CWebUser->init()

3 C:\xampp\htdocs\projects...\vendor\yiisoft\yii\framework\base\CModule.php(103): CModule->getComponent('user')

4 C:\xampp\htdocs\projects...\app\modules\users\UsersModule.php(30):CModule->__get('user')

5 C:\xampp\htdocs\projects...\app\components\RequestHandler.php(23): UsersModule->menu()

6【内部函数】:RequestHandler::onBeginRequest(Object(CEvent))

7 C:\xampp\htdocs\projects...\vendor\yiisoft\yii\framework\base\CComponent.php(559):call_user_func(Array,Object(CEvent))

8 C:\xampp\htdocs\projects...\vendor\yiisoft\yii\framework\base\CApplication.php(196): CComponent->raiseEvent('onBeginRequest', Object(CEvent))

9 C:\xampp\htdocs\projects...\vendor\yiisoft\yii\framework\base\CApplication.php(167): CApplication->onBeginRequest(Object(CEvent))

10 C:\xampp\htdocs\projects...\vendor\yiisoft\yii\framework\yiic.php(33): CApplication->run()

11 C:\xampp\htdocs\projects...\app\yiic.php(7):require_once

4

1 回答 1

0

CConsoleApplication.defaultController <- 错误

console.php = config 到 CConsoleApplication 检查 root/protected/config/console.php 是否设置为 defaultController

于 2014-05-13T05:01:30.357 回答