Laravel /storage/logs permission denied cpanel

Laravel /storage/logs permission denied cpanel
Laravel /storage/logs permission denied cpanel
Rate this page

In this guide, I will show you to fix common The stream or file “/var/www/html/project_name/storage/logs/laravel.log” could not be opened: failed to open stream: Permission denied or Laravel issue of Laravel /storage/logs permission denied in cpanel, this is most common issue when you migarte your website or change your laravel website files location or move your website to new location, here is the solution:

Step1. Delete the Data Folder and Create again under the location /public_html/storage/framework/cache/

Step2. Login To cPanel terminal/SSH (if you don’t have ssh access please contact your hosting provider and tell them to enable jailed ssh for your hosting).

Run the following artisan command.

php artisan config:clear

then the run 

php artisan cach:clear

Now the issue should be fixed and it should work fine.

Alternative solution:

Remove/delete the folder framework/cache and then create again.

Using Comment line interface Run:

rm -rf storage/framework/cache 
mkdir storage/framework/cache

Please Note: Laravel provides an expressive, unified API for various caching backends. The cache configuration is located at config/cache.php. In this file you may specify which cache driver you would like to be used by default throughout your application. 

Thank you, Don’t forget to share this article!