Hello artisan in this tutorial i am going to fix an error in Laravel and the error is failed to clear cache make sure you have the appropriate permissions. So how we can fix please provide a valid cache path error in Laravel? In this example i am going to show you the solution of this laravel 8 please provide a valid cache path error.
I will show you multiple solution to solve this error. I personally faced that issue and solved the problem when I created "framework" folder inside storage folder and its subfolders sessions, views and cache. Here, I will give you three solution for this error. So Let's see the solution as bellow.
Solution 1
We have to create storage folder inside "framework" folder. Please Follow this step:
cd storage/
mkdir -p framework/{sessions,views,cache}
We need to create folder after give the permission for the write data in this directory.
cd storage/
chmod -R 775 framework
chown -R www-data:www-data framework
Solution 2
In this another way solution we have to create storage folder in framework folder and framework folder in create bellow three directory.
You need to create cache folder in data directory. All folder are created, then after You can clear cache using bellow artisan command:
php artisan cache:clear
Solution 3
Now we are in the third solution. In this solution we have to create storage folder inside "framework" folder using bellow command to create session, view and cache in data:
sudo mkdir storage/framework
sudo mkdir storage/framework/sessions
sudo mkdir storage/framework/views
sudo mkdir storage/framework/cache
sudo mkdir storage/framework/cache/data
After doing all the command step successfully above command then after give the permission to storage folder using bellow command.
sudo chmod -R 777 storage
Hope it can help you.
#laravel #laravel-8x