php session_start permission denied

Warning: sessionstart() [function.session-start]: open(/var/lib/php5/sess3bf61c2d4a112448d55ceb8ac3d353df, ORDWR) failed: Permission denied (13) in /var/www/longschapelcc.org/publichtml/ministry.php on line 1

Warning: sessionstart() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /var/www/longschapelcc.org/publichtml/ministry.php:1) in /var/www/longschapelcc.org/public_html/ministry.php on line 1

Warning: sessionstart() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /var/www/longschapelcc.org/publichtml/ministry.php:1) in /var/www/longschapelcc.org/public_html/ministry.php on line 1

This dir /var/www/longschapelcc.org/ has been chown -R root:root already.

Any thoughts on why I'm getting this permission denied?

2 Replies

Whatever your web server is running as (and under no circumstances should PHP EVER be running as root) doesn't have permissions for /var/lib/php5/sess_3bf61c2d4a112448d55ceb8ac3d353df

So I changed the ownership of my sites in /var/www to www-data as that is the user that apache is running under.

I also set the ownership of /var/lib/php5/ to www-data

and the errors are gone now. /var/lib/php5 was initial set to root:root

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct