Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error session_start(): open(/var/lib/php/session error

Tags:

php

session

I am running my webserver and get the following error:

Error starting session: session_start():open(/var/lib/php5/sess_hienlq7a0i6im8tvfel989ji25, O_RDWR) failed: No such file or directory (2)

Reinstalling php5 gave no results.


2 Answers

Another possible solution: Check to see which user is running the httpd/apache process.

$ ps aux | egrep '(apache|httpd)'

View the directory owner (the error will tell you the path)

$ ls -la /var/lib/session

Give ownership of the folder to the server user

$ sudo chown serveruser:serveruser /var/lib/session

Hope this helps!

like image 152
Cody Wikman Avatar answered Mar 27 '26 00:03

Cody Wikman


In case you want to close your question, here is my comment.

Create a file with just <?php phpinfo(); in it. Look for what php.ini file is being loaded. Also check for the session save path. go into that php.ini file and set the session save path to something like a temp directory.

like image 22
Jonathan Kuhn Avatar answered Mar 27 '26 00:03

Jonathan Kuhn