尝试加载 Zend Framework 应用程序时出现此错误:
致命错误:/www/htdocs/w00a1ed7/autospin/redaktion/library/Zend/Session.php:462 中的消息“会话已由 session.auto-start 或 session_start() 启动的未捕获异常“Zend_Session_Exception”
堆栈跟踪:
#0 /www/htdocs/w00a1ed7/autospin/redaktion/library/Zend/Session/Namespace.php(143): Zend_Session::start(true)
#1 /www/htdocs/w00a1ed7/autospin/redaktion/library/Zend/Auth/Storage/Session.php(87): Zend_Session_Namespace->__construct('Zend_Auth')
#2 /www/htdocs/w00a1ed7/autospin/redaktion/library/Zend/Auth.php(91): Zend_Auth_Storage_Session->__construct()
#3 /www/htdocs/w00a1ed7/autospin/redaktion/library/Zend/Auth.php(141): Zend_Auth->getStorage()
#4 /www/htdocs/w00a1ed7/autospin/redaktion/application/layouts/scripts/layout.phtml(31): Zend_Auth->hasIdentity()
#5 /www/htdocs/w00a1ed7/autospin/redaktion/library/Zend/View.php(108): include('/www/htdocs/w00...')
#6 /www/htdocs/w00a1ed7/autospin/redaktion/library/Zend/View/Abstract.php(831): Zend_View->_run('/www/htdocs/w00...')
#7 /www/htdocs/w00a1ed 在 /www/htdocs/w00a1ed7/autospin/redaktion/library/Zend/Session.php 第 462 行
我Zend_Auth
在本地服务器上使用 and 它运行良好,但在生产服务器上我收到前面的错误,但不是每次都出现。
我已经检查了文件中的session.autostart
设置。0
.htaccess
如何修复此错误?
感谢您的回答,但我不在任何地方使用 session_start() 。仅与采埃孚合作。
我仅在共享服务器上遇到此问题,在我的本地服务器脚本上运行良好。
我将 INIT 函数与此代码一起使用:
受保护的$用户;
public function init()
{
if(!Zend_Auth::getInstance()->hasIdentity())
{
$this->_redirect('auth/login');
}else
{
$this->user = Zend_Auth::getInstance()->getIdentity();
}
}
我已经尝试仅在 indexAction 中设置 tis 代码,这样其他操作就不必破解 Auth... 但仍然有问题。
有没有办法在 Action 中设置不检查会话或类似这样的想法?
最好的问候