0
votes

ErrorException (E_WARNING) file_put_contents(/var/www/html/moha/storage/framework/sessions/rGlwXEnWZF6hnlZY9URsoioiFSjnDsHZyzpbJLiV): failed to open stream: Permission denied

2
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 777Ranjan 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/