ErrorException (E_WARNING)
file_put_contents(/var/www/html/moha/storage/framework/sessions/rGlwXEnWZF6hnlZY9URsoioiFSjnDsHZyzpbJLiV):
failed to open stream: Permission denied
Hint: chmod path /var/www/html/moha/storage/framework/sessions/ chmod level 600 should work to allow PHP user to make files.
– Raymond Nijland
I tried this too.. it didnt even work for 777
– Ranjan Adhikari
what does ls -l within the path /var/www/html/moha/storage/framework/ print.. Also use PHP functions like getmyuid() and getmygid() and get_current_user() to get information about PHP's user.. i have a feeling you also need to change the folder group to the php's user group.
– Raymond Nijland
2 Answers
2
votes
Try this. This command allows you edit your file in without root permission.
sudo chmod -R 777 /var/www/html/moha/storage/
0
votes
Your webserver (Apache, Nginx or other) should be able to write on the storage directory. Consider that www-data is the webserver user (default), at root of your project, run the following commands:
sudo chown -R www-data. storage/
sudo chmod -R 777 storage/
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more
/var/www/html/moha/storage/framework/sessions/
chmod level 600 should work to allow PHP user to make files. – Raymond Nijlandls -l
within the path/var/www/html/moha/storage/framework/
print.. Also use PHP functions likegetmyuid()
andgetmygid()
andget_current_user()
to get information about PHP's user.. i have a feeling you also need to change the folder group to the php's user group. – Raymond Nijland