Laravel showing “Failed to clear cache. Make sure you have the appropriate permissions”

后端 未结 12 2246
逝去的感伤
逝去的感伤 2020-12-10 00:58

Laravel was displaying to me \"Access denied for user \'homestead\'@\'localhost\' (using password: YES)\". One solution for this was clearing the cache and the config cache

相关标签:
12条回答
  • 2020-12-10 00:58

    Calling

    php artisan config:cache 
    

    before

    php artisan cache:clear
    

    fixed the issue.

    0 讨论(0)
  • 2020-12-10 00:59

    Had the same problem on my vagrant/homestead VM. All the other things in this thread didn't help.

    The solution was vagrant reload --provision

    0 讨论(0)
  • 2020-12-10 01:02

    Can't this solve it?

    $php artisan optimize:clear
    Compiled views cleared!
    Application cache cleared!
    Route cache cleared!
    Configuration cache cleared!
    Compiled services and packages files removed!
    
    0 讨论(0)
  • 2020-12-10 01:03

    I ran my project in a docker container, then later tried accessing it via laragon, I had similar issue, this was due to compiled configurations in /bootstrap/cache/config.php.

    I fixed fit by running php artisan config:clear, this deletes the /bootstrap/cache/config.php file automatically.

    0 讨论(0)
  • 2020-12-10 01:05

    You should update the permission using the below command-/

    sudo chown -R www-data:www-data ./storage

    This will resolve your below issue

    0 讨论(0)
  • 2020-12-10 01:07

    First try:

    Check if there is a "data" folder inside "storage/framework/cache/". If there is not, then create it manually. (create a new folder with name "data")

    Option 2:

    If there is a "data" folder inside "storage/framework/cache/". Remove ALL existing folders inside there.

    Then final, running this:

    php artisan cache:clear
    

    This should fix this issue: "Failed to clear cache. Make sure you have the appropriate permissions."

    0 讨论(0)
提交回复
热议问题