The Cause of Error
This error it's caused by the missing "storage/framework" directory and its respective sub directories. Because of this, the application will throw an error saying "Please provide a valid cache path".
The Fix to the Error
The fix to this error is to have the following directories inside the "storage" folder.
framework framework/cache framework/sessions framework/views
The path is as follows.
/path/to/laravel/storage/framework/
Step 1 - Create Missing Directory
To create the missing directory you can SSH to the server and create the storage with the command line. Do note that it's assumed you are in the root directory of your Laravel application.
cd storage mkdir -p framework/{sessions,views,cache}
The command below will create the 3 sub-directory "session", "views" and "cache" inside the framework directory.
Step 2 - Set Directory Permission
Finally set the directory permission to allow write to the directory.
chmod -R 777 framework chown -R www-data:www-data framework
Step 3 - Run Link Storage Command
The final step is to run "php artisan storage:link" command and this will link your "storage" directory with the "/public/storage" directory.
php artisan storage:link
You might also need to clear the cache in Laravel to clean up any existing cache.
Leave a reply