2015-03-13 21 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 ...