Yii,yiic抛出异常CConsoleApplication.defaultController

时间:2014-03-18 07:09:37

标签: yii frameworks yiic

异常'CException',消息'Property“CConsoleApplication.defaultContro ller“未定义。”在.. \ yiisoft \ yii \ framework \ base \ CComponent.php:173

是否有人遇到此错误? 解决方案是什么?

感谢您的回应。

异常'CException',消息'Property“CConsoleApplication.defaultContro ller“未定义。”在C:\ xampp \ htdocs \ projects ... \ vend 或\ yiisoft \ YII \框架\基\ 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-&gt; __ construct('C:\ xampp \ htdocs ...')< / H1>

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我收到此错误:

异常'CException',消息'CConsoleApplication及其行为不行 有一个名为“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&gt; __ call('getSession',Array)

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

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

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

4 C:\ xampp \ htdocs \ projects ... \ app \ modules \ users \ UsersModule.php(30):CModule-&gt; __ get('user')

5 C:\ xampp \ htdocs \ projects ... \ app \ components \ RequestHandler.php(23):UsersModule-&gt; 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-&gt; raiseEvent('onBeginRequest',Object(CEvent))

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

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

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

1 个答案:

答案 0 :(得分:0)

CConsoleApplication.defaultController&lt; - 错误

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