Home > front end >  Laravel 8 permission denied in shared hosting
Laravel 8 permission denied in shared hosting

Time:02-06

I have my laravel 8 app hosted in hostinger hpanel but for hours I have trying to fix this error.

UnexpectedValueException There is no existing directory at "There is no existing directory at "/Users/macbookpro/Documents/Theodory/projectName/storage/logs" and it could not be created: Permission denied" and it could not be created: Permission denied missing folder is from my machine instead of cpanel path.

I have tried find and delete ../bootstrap/cache/config.php but there is no such a file and I have tried to delete all storage/logs but am still getting that error and I have tried to add manually in web.php

Route::get('/optimize',function(){
 Artisan::class('optimize:clear');

});

But when I hit /optimize am still getting the same error.

I have decided to use hostinger ssh so that I can be able to run artisan commands but am still getting same error even after hitting artisan commands successful.

What can I make it work in hostinger hpanel to which is similar to traditional cpanel.

CodePudding user response:

try the following commands and hit again /optimize

php artisan route:clear

php artisan config:clear

php artisan cache:clear

CodePudding user response:

try these artisan commands

php artisan optimize:clear

after that, you should run this command

php artisan optimize

CodePudding user response:

you are facing this issue because your application doesn't have proper permissions for the storage directory.

Use this command to grant required permissions to the storage directory, and this should resolve the issue.

chmod 777 -R storage/

  •  Tags:  
  • Related