1
votes

I am facing this issue in AWS Server,

The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied

And I give permission to "777",Now

sudo chmod -R 755 storage/

sudo chmod -R 777 storage/

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

I receive this error Please help me to fix.

2
are u using cent os .? and please mention your OSKamlesh Paul
Yes I am using CentOS 7.8.selva
try this sudo chcon -t httpd_sys_rw_content_t storageKamlesh Paul
Not working to me,My app url :subdomain.domain.com ,Any settings need for subdomian?selva
it not related to domain it just a permission issueKamlesh Paul

2 Answers

0
votes

as u r using CentOS 7.8

try sudo chcon -t httpd_sys_rw_content_t storage to give full permission to storage

0
votes

This question is really trending when it comes to Laravel. The best suggestion I can give is change read/write/exec permissions of your storage folder like:

sudo chmod -Rf 755 storage

The -f is to make command run on subfiles and subdirectories all through

And make sure apache and user has access/ownership to storage folder like:

sudo chown -Rf username:apache storage

Importantly: Always avoid using 777 as it gives permission to anyone to have access to your files and folder outside your usergroup.

Selah!