我的项目在 ZF 1.11 下运行,它随机抛出此错误:
Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'Zend_Session::start() - /home/user/www/MyProject/library/Zend/Session.php(Line:469): Error #8 session_start() [<a href='function.session-start'>function.session-start</a>]: ps_files_cleanup_dir: opendir(/tmp) failed: Permission denied (13) Array' in /home/user/www/MyProject/library/Zend/Session.php:482 Stack trace:
#0 /home/user/www/MyProject/library/Zend/Session/Namespace.php(143): Zend_Session::start(true)
#1 /home/user/www/MyProject/library/Dlx/Acl/Permissao.php(8): Zend_Session_Namespace->__construct('user_info')
#2 /home/user/www/MyProject/application/Bootstrap.php(72): Dlx_Acl_Permissao->__construct(Object(Zend_Db_Adapter_Pdo_Mysql))
#3 /home/user/www/MyProject/library/Zend/Application/Bootstrap/BootstrapAbstract.php(669): Bootstrap->_initLoaders()
#4 /home/user/www/MyProject/library/Zend/Application/Bootstrap/BootstrapAbstract.php(622): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('loaders')
#5 /home/user/ in /home/user/www/MyProject/library/Zend/Session.php on line 482
如您所见,它尝试清除 /tmp 目录中的会话,但在我的 application.ini 中,配置将 session.save_path 设置为 APPLICATION_PATH "/../data/session"(ZF 默认配置),并保存会话在这个路径中,但是当 gc 运行时,它会尝试清理错误的目录
这是我的 application.ini 会话配置:
顺便说一句,/data 和 /data/session 权限设置为 777
有任何想法吗 ?