There is no existing directory at /storage/logs and its not buildable: Permission denied
Solution 1
Please try the following commands
php artisan route:clear
php artisan config:clear
php artisan cache:clear
Note: In case you are a Homestead & VirtualBox user, please be sure that your VirtualBox is up to date.
It helped in this thread at laracasts
Solution 2
Clear the cache and config, then deploy to the live server.
If you've already uploaded to the live server, then you have to follow these steps:
- Delete
bootstrap/cache/config.php
- Delete all log files in
storage/logs
.
Solution 3
You don't need to add any permission on the storage file.
- The main problem here is in the compiled file, and due to which laravel try to show an error.
- By default in laravel, storage file not having permission to show in the console (error shows from the error.log file).
- So the thing you need to fix is to fix compile file. which can be done thought this single command
This command will clear all your cache
- Compiled views
- Application cache
- Route cache
- Configuration cache
Use this
php artisan optimize:clear
Solution 4
After changing local conf i got the same error over and over, try this, probably will help.
rm bootstrap/cache/config.php
and then
php artisan cache:clear
depending on your scenario, reloading auto-loader file can solve your issue, for that use :
composer dump-autoload
or sometimes just try :
composer install
this do the two the commands listed above.
Solution 5
go to your vagrant
then run
vagrant ssh
php artisan config:cache
Admin
Updated on November 24, 2021Comments
-
Admin over 2 years
I have a problem with my Laravel deployment on a OVH web server. After made
composer update php artisan cache:clear php artisan route:clear php artisan dump-autoload
I have this answer:
There is no existing directory at /storage/logs and its not buildable: Permission denied
I put all the files on 777 chmod but I have always this answer. -
PilouPili over 5 yearsCould you give a little more detail on what this accomplishes
-
Amirreza Nasiri almost 5 years💥 You're a life saver! I had some stupid CORS issue and solved by the command.
-
Vikas Rinvi almost 5 yearsI am happy that it helps. @AmirrezaNasiri Thanks for your comment too.
-
Alexander Taubenkorb over 4 yearsWorked, even if it said "Failed to clear cache. Make sure you have the appropriate permissions." :-)
-
Erik Donohoo over 4 yearsIf you are using vagrant/docker/etc make sure to run
php artisan config:cache
from inside the machine. -
Ali Hassan about 4 yearsThe best answer for shared hosting 👍🏼
-
Ihab Shoully almost 4 yearsThis sequence (route, config, then cache) worked for me!
-
Farbod Ahmadian almost 4 yearsUsing
777
permission is a REALLY bad permission and it has so many security issues because it giveRWX
permission to every body! -
Buddhika almost 4 years@FarbodAhmadian thanks, I change my permissions to 755 also work for me. I edit my above answer also after your comment.
-
Chanchal Raj almost 4 yearsFor last command: Failed to clear cache. Make sure you have the appropriate permissions.
-
frankfurt-laravel almost 4 yearsChanchal: Here you go stackoverflow.com/questions/52231248/… Was a one sec search.
-
widi83 almost 4 yearsGreats. Work for me to for shared hosting.
-
Canelo Digital almost 4 yearsThis works great... in my case it was also the config... But does anyone understand what the underlying problem is? Is it an issue in the configuration? or an error in how the config cache is built (e.g. ignoring .env or something like that?) It seems that folders are there, have the right permissions, etc. so something seems to be smelly, I just can't point at it...
-
Donny van V over 3 yearsThanks! This helped me a lot!
-
Farid shahidi over 3 yearsFirst you need to run your vagrant env, then you should connect to its bash script using vagrant ssh, config cache will clear the cached config files, then rebuild them.
-
hannebaumsaway about 3 yearsI do this and it gets rid of the error stated in the question here, but then I get a 500 Internal Error in its place. Any thoughts?
-
insign almost 3 yearsOnly Jesus know why this is related with
Redis error: cannot assign requested address
but now is fixed. -
shasi kanth almost 3 yearsGreat, thanks! Worked for me with Docker.
-
Mystogan over 2 yearsWell this solve the issue. Thank you so much!
-
Dany Balian over 2 yearsjust removing the config file and clearing the cache worked for me (no need for composer commands).. thx for the help
-
qotsa42 about 2 yearsIf this problem persists while running Laravel locally inside a Docker container, make sure you execute these commands inside the container.
-
Sohaib Khan about 2 yearssimple and working solution thanks alot