There is no existing directory at /storage/logs and its not buildable: Permission denied

121,900

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:

  1. Delete bootstrap/cache/config.php
  2. 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

Share:
121,900
Admin
Author by

Admin

Updated on November 24, 2021

Comments

  • Admin
    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
    PilouPili over 5 years
    Could you give a little more detail on what this accomplishes
  • Amirreza Nasiri
    Amirreza Nasiri almost 5 years
    💥 You're a life saver! I had some stupid CORS issue and solved by the command.
  • Vikas Rinvi
    Vikas Rinvi almost 5 years
    I am happy that it helps. @AmirrezaNasiri Thanks for your comment too.
  • Alexander Taubenkorb
    Alexander Taubenkorb over 4 years
    Worked, even if it said "Failed to clear cache. Make sure you have the appropriate permissions." :-)
  • Erik Donohoo
    Erik Donohoo over 4 years
    If you are using vagrant/docker/etc make sure to run php artisan config:cache from inside the machine.
  • Ali Hassan
    Ali Hassan about 4 years
    The best answer for shared hosting 👍🏼
  • Ihab Shoully
    Ihab Shoully almost 4 years
    This sequence (route, config, then cache) worked for me!
  • Farbod Ahmadian
    Farbod Ahmadian almost 4 years
    Using 777 permission is a REALLY bad permission and it has so many security issues because it give RWX permission to every body!
  • Buddhika
    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
    Chanchal Raj almost 4 years
    For last command: Failed to clear cache. Make sure you have the appropriate permissions.
  • frankfurt-laravel
    frankfurt-laravel almost 4 years
    Chanchal: Here you go stackoverflow.com/questions/52231248/… Was a one sec search.
  • widi83
    widi83 almost 4 years
    Greats. Work for me to for shared hosting.
  • Canelo Digital
    Canelo Digital almost 4 years
    This 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
    Donny van V over 3 years
    Thanks! This helped me a lot!
  • Farid shahidi
    Farid shahidi over 3 years
    First 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
    hannebaumsaway about 3 years
    I 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
    insign almost 3 years
    Only Jesus know why this is related with Redis error: cannot assign requested address but now is fixed.
  • shasi kanth
    shasi kanth almost 3 years
    Great, thanks! Worked for me with Docker.
  • Mystogan
    Mystogan over 2 years
    Well this solve the issue. Thank you so much!
  • Dany Balian
    Dany Balian over 2 years
    just removing the config file and clearing the cache worked for me (no need for composer commands).. thx for the help
  • qotsa42
    qotsa42 about 2 years
    If this problem persists while running Laravel locally inside a Docker container, make sure you execute these commands inside the container.
  • Sohaib Khan
    Sohaib Khan about 2 years
    simple and working solution thanks alot