Suppose your database is located at /var/www/html/myapp/database/database.sqlite
. Here is a consolidated approach:
- Set Permissions:
bash
Copy code
sudo chown www-data:www-data /var/www/html/myapp/database/database.sqlite
sudo chmod 664 /var/www/html/myapp/database/database.sqlite
sudo chown -R www-data:www-data /var/www/html/myapp/database
sudo chmod -R 775 /var/www/html/myapp/database
- Configure .env File:
dotenv
Copy code
DB_CONNECTION=sqlite
DB_DATABASE=/var/www/html/myapp/database/database.sqlite
- Clear Laravel Cache:
bash
Copy code
php artisan config:clear
php artisan cache:clear
php artisan config:cache