PHP Warning: Unknown: Failed to write session data (files)

Created:

2017-01-09 16:51:24 UTC

Modified:

2017-08-08 13:46:16 UTC

0

Was this article helpful?


Have more questions?

Submit a request

PHP Warning: Unknown: Failed to write session data (files)

Issue Symptoms

The following errors can be found in /var/www/vhost/example.com/logs/error_log:  

[error] PHP Warning:  session_start(): open(/var/lib/php/session/sess_ds1jodboir8trn15gca9vqbq65, O_RDWR) failed: Permission denied (13) in /var/www/vhosts/example.com/httpdocs/script.php on line 7
[error] PHP Warning: Unknown: open(/var/lib/php/session/sess_ds1jodboir8trn15gca9vqbq65, O_RDWR) failed: Permission denied (13) in Unknown on line 0
[error] PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0

Conditions

Incorrect permissions on /var/lib/php/session.

Resolution

Set the correct permissions:

# chmod 1733 /var/lib/php/session
Have more questions? Submit a request
Please sign in to leave a comment.