问题描述
我收到此错误:
错误:[CakeSessionException]无法配置会话,设置session.auto_start失败。 code>
Error: [CakeSessionException] Unable to configure the session, setting session.auto_start failed.
我使用Cakephp 2.2.4。
I'm using Cakephp 2.2.4.
strong>
EDIT
这个人似乎有同样的问题:并使用此
It seems this guy had the same issue: Cakephp Session error on live site and using this
if(!isset($_SESSION)) session_start();
在 beforefilter
c> AppController 修复错误。
inside beforefilter
method of AppController
fix the error.
所以我的问题是:为什么会发生?一切工作正常,然后suddendly这个错误出现。
此外,我意识到文件夹 app / tmp / sessions
是空的,我已经配置了由Cake处理的会话(在 Configuration / core.php
)。
So my question is: why this happened? Everything was working fine and then suddendly this error appeared.Additionally I've realized that the folder app/tmp/sessions
is empty and I have configured the session to be handled by Cake (in Config/core.php
).
推荐答案
CakePHP仅在2.4.0版本中将此选项从默认会话配置中删除。
CakePHP removed this option from default session configuration only in 2.4.0 version.
所以你有3个主要选项:升级CakePHP,降级PHP,或使用标准的php会话。
So you have 3 main option: upgrade CakePHP, downgrade PHP, or use standard php session.
这篇关于CakePHP错误:无法配置会话,设置session.auto_start失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!