Failed to write session data (files)

user1025771 picture user1025771 · Apr 15, 2013 · Viewed 32k times · Source

I just ordered a vps server by a hosting party. It's a CentOS with Plesk 11. So i just installed my Zend applicaton on the server but now the error log states

[Mon Apr 15 20:48:28 2013] [warn] [client 94.210.222.87] mod_fcgid: stderr: PHP Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'Zend_Session::start() - /var/www/vhosts/ontwerp.doedels.eu/httpdocs/mvc/libraries/Zend/Session.php(Line:469): Error #2 session_start(): open(/var/www/vhosts/ontwerp.doedels.eu/tmp/sess_t2orkniqjn9rsn9m84d2clsdd1, O_RDWR) failed: Permission denied (13) Array 
[Mon Apr 15 20:48:28 2013] [warn] [client 94.210.222.87] mod_fcgid: stderr: /var/www/vhosts/ontwerp.doedels.eu/httpdocs/mvc/libraries/Zend/Session.php(Line:479): Error #2 session_write_close(): open(/var/www/vhosts/ontwerp.doedels.eu/tmp/sess_t2orkniqjn9rsn9m84d2clsdd1, O_RDWR) failed: Permission denied (13) Array 
[Mon Apr 15 20:48:28 2013] [warn] [client 94.210.222.87] mod_fcgid: stderr: /var/www/vhosts/ontwerp.doedels.eu/httpdocs/mvc/libraries/Zend/Session.php(Line:479): Error #2 session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/www/vhosts/ontwerp.doedels.eu/tmp) Array' in /var/www/vhosts/ontwerp.doedels.eu/httpdocs/mvc/libraries/Zend/Session.php:482 

What did i try so far? I tried setting session.save_path to {DOCUMENTROOT}/tmp and {WEBSPACEROOT}/tmp this doens't seem to work.

The phpinfo function says that session.save_path = /var/www/vhosts/ontwerp.doedels.eu/tmp which is the good folder. The path exists and the folder has 777 CHMOD rights.

Work around It seems to work when i set session.save_path = {WEBSPACEROOT}/private/sess That is a folder i made with 777 chmod permissions, yet it doens't seems to be a permanent solution. Since i have to create this folder by every subscription i make.

What do i know for sure?

  • The folder is not full
  • The folder does exists
  • The folder has writing permissions 777
  • The folder owner is 0
  • Running the server on fastcgi modus

Answer

chandresh_cool picture chandresh_cool · Apr 15, 2013

You need set permission for your var directory. That seems to be the problem.