session_start(): open(/var/lib/php5/sess_ibfocfkgbpfaoimac34nkjotp2, O_RDWR) failed
Solution 1
The session save handler needs to be able to write on the disk. The file system denies writing. That's causing your issue.
Change the session save path to a writeable directory.
Solution 2
If you're using PHP FPM and have set session_save_path in your pools, make sure you add a forward slash before the directory (absolute URL). This is what the problem was for me.
Related videos on Youtube
Jiew Meng
Web Developer & Computer Science Student Tools of Trade: PHP, Symfony MVC, Doctrine ORM, HTML, CSS, jQuery/JS Looking at Python/Google App Engine, C#/WPF/Entity Framework I hope to develop usable web applications like Wunderlist, SpringPad in the future
Updated on June 04, 2022Comments
-
Jiew Meng almost 2 years
I am trying to register as a new user on a Symfony 2 project, i've been working on. This popped up all of a sudden. It was working in office yesterday, and I've setup a similar setup at home. I got:
Warning: session_start(): open(/var/lib/php5/sess_ibfocfkgbpfaoimac34nkjotp2, O_RDWR) failed: Read-only file system (30) in /home/projects/notes/app/cache/dev/classes.php line 406
Whats wrong?
-
Jiew Meng over 12 yearsAny idea why this might have popped up suddenly? Havent saw this error before. Anyway, I tried
chmod 777 /var/lib/php5 -R
, still got that error. Set thesession.save_path = /tmp
, restarted apache, still same error (PHP tries to save still in/var/lib/php5
) -
Jiew Meng over 12 yearsOh, I made a mistake it was redirecting me to the remote server ... but why does PHP not set it to tmp by default?
/var/lib/php5
is owned by root for me by default on Ubuntu? -
hakre over 12 yearsCheck your php.ini file, the defaults are configured in there.