independent full stack developer

/ Developer's blog

HotFix: Laravel - Failed to open stream: Permission denied

Saturday, April 20, 2024

#laravel #error

Sometimes it happens :) if you stumbled with error about file_get_content and permission denied - failed to open the stream in Laravel 5, try these commands, and everything should be fixed. Try this code if the error occurs on the localhost and dev server.

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

Update!

I forgot to say that we should avoid 777 chmod on production, if you get this error on your production live stage - try to set 755 instead.

 

30988 people already saw it