2015-03-13 45 views
0

我是CakePHP框架的新手(更多的Yii人),所以我的問題可能看起來很愚蠢,但我整天都陷入這個問題。我想創建控制檯命令shell來執行,但也有一些是錯誤的會話初始化我不斷得到錯誤(?):cakephp cli中的會話錯誤

PHP Notice: Undefined index: cookie in E:\htdocs\project\lib\Cake\Model\Datasource\CakeSession.php on line 485 
PHP Notice: Undefined index: timeout in E:\htdocs\project\lib\Cake\Model\Datasource\CakeSession.php on line 491 
PHP Warning: ini_set(): session.name cannot be a numeric or empty '' in E:\htdocs\project\lib\Cake\Model\Datasource\CakeSession.php on line 500 
PHP Fatal error: Uncaught exception 'CakeSessionException' with message 'Unable to configure the session, setting session.name failed.' in E:\htdocs\project\lib\Cake\Model\Datasource\CakeSession.php:501 

爲什麼CakePHP的不加載core.php中配置值?在我的配置我設置:

Configure::write('Session', array(
    'defaults' => 'php' 
)); 

Configure::write('Session.cookie', 'PROJECT'); 
Configure::write('Session.timeout', '28800'); 

的CakePHP版本2.4.7

回答

0

好了,會不會有人來這個問題,還有要注意的事情。在Windows中,無法運行cake命令好了就可以了,但通知行cake.bat文件:

:: In order for this script to work as intended, the cake\console\ folder must be in your PATH 

或運行php cake.php ...