Laravel migration error throwing directory from old host even after migration to new host

47 Views Asked by At

I migrated my laravel saas site from one host to another but its throwing error:

There is no existing directory at "/home4/username/abc.com/storage/logs" and it could not be created: Permission denied.

How it fix it? Please help.

I gave permissions to the logs folder and even changed the database but still the issue and the path it is showing belongs to my old host but I have migrated my website to new host.

1

There are 1 best solutions below

3
Muhanned Masoud On

Start by checking the .env file on the new host.

Verify the user running apache2 or nginx has correct permissions to these Laravel folders.

sudo chown -R www-data:www-data storage bootstrap/cache
sudo chmod -R 775 storage bootstrap/cache

In the config/logging.php, check folders and code there for logging.

Clear all cache

php artisan config:clear
php artisan cache:clear
php artisan view:clear
php artisan route:clear