session_start(): open(/var/lib/php5/sess_ibfocfkgbpfaoimac34nkjotp2, O_RDWR) failed

14,762

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.

Share:
14,762

Related videos on Youtube

Jiew Meng
Author by

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, 2022

Comments

  • Jiew Meng
    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
    Jiew Meng over 12 years
    Any 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 the session.save_path = /tmp, restarted apache, still same error (PHP tries to save still in /var/lib/php5)
  • Jiew Meng
    Jiew Meng over 12 years
    Oh, 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
    hakre over 12 years
    Check your php.ini file, the defaults are configured in there.