installed laravel on my xampp installation on ubuntu. opened it in browser. got the error:
The stream or file /storage/logs/laravel log could not be opened: failed to open stream: Permission denied
how to fix? (i’ve already found an answer, will post right now)
2
Answers
the problem is that the user under which the apache runs doesn't have access to the folder. in xampp on ubuntu, the user of main apache process is
root
. but apache workers run underdaemon
user. the solution is to grantdaemon
access to the/storage
dir. (if you'll only grant to/storage/logs
than you'll fix this error, but the same error will occur with sibling dirs. thus thestorage
itself folder:now the
daemon
user has access to this folder (and you don't but do you need it? if you have better solutions, please feel free to share them here!Add to
composer.json
Then run composer install or update solve your issue