0

My Project is running under ZF 1.11, and it throws this error randomly:

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

As you can see, it tries to clean the session in /tmp directory, but in my application.ini the configuration sets session.save_path to APPLICATION_PATH "/../data/session" (ZF default conf), and it saves the session in this path, but when gc runs, it tries to clean in the wrong directory

This is my application.ini session configuration:

http://codepad.org/mJUyipG0

Btw, /data and /data/session permission are set to 777

Any ideas ?

akond
  • 15,865
  • 4
  • 35
  • 55
Hectore
  • 25
  • 1
  • 4

1 Answers1

1

Check your php.ini /tmp seems top be the default directory for php session saves. Although in my installation the save path line is commented out. ;session.save_path = "/tmp"

You can also debug by dumping Zend_Session::getOptions(); (it is a static method) to make sure your parameters are being correctly set.

This might be the cause of the exception:

string save_path - The correct value is system dependent, and should be provided by the developer using an absolute path to a directory readable and writable by the PHP process. If a writable path is not supplied, then Zend_Session will throw an exception when started (i.e., when start() is called).

Hopefully it's this simple, just supply an absolute path and check permissions.

The .. in the path may be the problem. APPLICATION_PATH "/../data/session"

RockyFord
  • 8,529
  • 1
  • 15
  • 21