Wednesday, October 17, 2018

Solution To: Laravel Error failed to open stream: Permission denied



PROBLEM:

Laravel Error failed to open stream: Permission denied

SOLUTION:

Most folders should be normal "755" and files, "644"

Laravel requires some folders to be writable for the web server user. You can use these command on *nix based OSs.

Using ACL

// nginx = web server user
// systemuser = your local user which you use to login via ssh
sudo setfacl -Rdm u:nginx:rwx,u:systemuser:rwx storage
sudo setfacl -Rm u:nginx:rwx,u:systemuser:rwx storage

Alternatively, if you don't have ACL

sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache


REFERENCE:
https://laracasts.com/discuss/channels/general-discussion/laravel-framework-file-permission-security
https://stackoverflow.com/questions/30639174/file-permissions-for-laravel-5-and-others

1 comment:

Labels