independent full stack developer

/ Developer's blog

How to fix Laravel 5.8 artisan command Failed to clear cache. Make sure you have the appropriate permissions

Monday, September 20, 2021

I just deployed a new system on production, opened a browser and see the error about permissions for my Laravel logs and do on, I checked the default paths, vhosts, config...but nothing happens. Then I think that clearing Laravel config cache with the command is a good idea.

php artisan config:clear

But I got the error

Failed to clear cache. Make sure you have the appropriate permissions.

I nothing can help me :( The next thing was checking the files, and remove these ones

rm /bootstrap/cache/packages.php
rm /bootstrap/cache/services.php
rm /bootstrap/cache/config.php.php

Then run

php artisan cache:clear

And voila, it works!

P.S. What else I tried I had to be sure that folder /storage/framework/cache/data exist, and have the correct owner and chmod.

 

3614 people already saw it