PHP Warning – Failed to Write Session Data
I’ve seen this error pop up a few times, but it usually happens when I choose to install LightTPD instead of Apache.
Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct.
What this means is that the path designated in your php.ini to store session data either does not exist or is not writable by the web server. When you are experiencing this warning from the php backend, the web facing tier of your application most likely has no session persistence at all.
How do we resolve this? Well, you just have to correct your session.save_path variable in your php configuration file, which is usually available at /etc/php.ini, so go ahead and open that up.
Find the line
session.save_path = "/var/lib/php/session"
Replace with (or comment out and add after)
session.save_path = "/tmp"
Once you’ve saved the change to your php configuration, go ahead and reboot your web server. You shouldn’t be experiencing this error anymore.



