Monthly Archives: October 2012

A fix for PHP session issues on AWS elastic beanstalk

Today while working on AWS elastic beanstalk I ran into a few errors I had not seen in development…

[10-Oct-2012 03:48:50 UTC] PHP Warning: Unknown: open(/var/lib/php/session/sess_e69e7lpl02imk74niqlufju336, O_RDWR) failed: Permission denied (13) in Unknown on line 0

[10-Oct-2012 03:48:50 UTC] PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0

To fix

  • SSH into Instance
  • $ sudo chown elasticbeanstalk.elasticbeanstalk /var/log/php-error.log
  • $ sudo service httpd restart
To figure out what user your httpd is running under find this file and search for /etc/httpd/conf/httpd.conf and find “User”.
That should fix it.