Ranjan Adhikari
Ranjan Adhikari

Reputation: 261

permission denied on database and file on web server

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

Upvotes: 0

Views: 823

Answers (2)

moreirapontocom
moreirapontocom

Reputation: 458

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/

Upvotes: 0

Tai Le
Tai Le

Reputation: 493

Try this. This command allows you edit your file in without root permission.

sudo chmod -R 777 /var/www/html/moha/storage/

Upvotes: 2

Related Questions