Trying to change the user Apache runs as and getting error when using sessions

Posted on

Trying to change the user Apache runs as and getting error when using sessions – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, apache-2.2, php, , .

I have changed the user Apache runs under and am getting the following when trying to use sessions in PHP:

Warning: Unknown: open(/var/lib/php/session/sess_phbfugace53ngs8kt9pdgovf21, O_RDWR) failed: Permission denied (13) in Unknown on line 0

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

I ran chown myuser /var/lib/php/session and still get the error. What else do I need to do?

Solution :

Ok, managed to sort this with chown myuser /var/lib/php/session -R

Leave a Reply

Your email address will not be published. Required fields are marked *