我是CakePHP框架的新手(更多的Yii成员),所以我的问题在某些人看来可能很愚蠢,但是我整天都被这个问题困扰着。我正在尝试创建控制台命令,以便在shell中执行,但是会话初始化(?)有问题。我经常犯错误:
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
发布于 2015-03-20 09:37:28
好的,如果有谁会发现这个问题,有件事需要注意。在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..。
https://stackoverflow.com/questions/29028666
复制相似问题