If the data
directory doesn't exist under (storage/framework/cache/data
), then you will have this error.
This data
directory doesn't exist by default on a fresh/new installation.
Creating the data
directory manually at (storage/framework/cache
) should fix this issue.
Try deleting these cached files under bootstrap folder:
/bootstrap/cache/packages.php
/bootstrap/cache/services.php
/bootstrap/cache/config.php
Then run php artisan cache:clear
Calling
php artisan config:cache
before
php artisan cache:clear
fixed the issue.
Just only add folder named data
in storage/framework/cache/
and try:
php artisan cache:clear
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."
Calling the following 4 commands should fix most of the permission issues on laravel.
sudo chown -R $USER:www-data storage
sudo chown -R $USER:www-data bootstrap/cache
chmod -R 775 storage
chmod -R 775 bootstrap/cache
Basically, chown -R $USER:www-data
what this does is it set current user $USER
as owner and www-data
as group and chmod -R 775
gives 7 to user,7 to group and 5 to other.
#PS: You need to run above command from the laravel project directory, else, you need to provide full path like /var/www/project_name/storage
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With