skip to Main Content

I’m currently working on a Laravel application, and I’ve encountered an issue with clearing the cache. I’ve attempted to use the artisan command php artisan cache:clear, but it results in an error message stating "Failed to clear cache. Make sure you have the appropriate permissions."

Are there any alternative solutions or troubleshooting steps to successfully clear the cache in a Laravel application when the artisan command fails due to permission issues?

2

Answers


  1. Just give a permission for storage and bootstrap folder using below command.

    cd yourproject
    yourproject> sudo chmod -R 777 storage/ bootstrap/
    

    Then you run the php artisan cache:clear

    Login or Signup to reply.
  2. I have seen this solution on https://www.tutsmake.com/laravel-delete-cache-files-manually/, which is working in my case.

    Run the following command on cmd or manually delete all cache files:

    cd bootstrap/cache/
    rm -rf *.php
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search