Laravel 5 - ErrorException failed to open stream: Permission denied

To solve this problem I needed to create a few folder's that were missing from my install. You require the following folders to be readable and writable by your www user:

/storage
/storage/cache
/storage/framework
/storage/framework/sessions
/storage/framework/views
/storage/framework/cache
/storage/logs

Also, set the folder permissions to 775. From the root directory run the command: sudo chmod -R 755 storage


If nothing help you and if you work on windows with docker it can be the issue that wrong symlink you have, you can try:

ln -s /var/www/storage/app/public /var/www/public/storage

And after that:

chown -R $USER:www-data storage

chmod -R 777 storage

on docker bash.


I solved the problem with this solution, clarifying that if you have Windows, you apply lines 1 and 3 and it works the same.

php artisan cache:clear
chmod -R 777 storage/
composer dump-autoload