Step-by-Step Guide
Connect to Your EC2 Instance via SSH
Connect to your EC2 instance using SSH. Replace /path/to/your-key.pem with the path to your SSH key, and your-ec2-instance-public-dns with the public DNS of your EC2 instance.
ssh -i /path/to/your-key.pem ubuntu@your-ec2-instance-public-dns
Navigate to Your Laravel Project Directory
Change to the directory where your Laravel project is located.
cd /var/www/html/your-laravel-project
Clear Laravel Caches
Use the following Artisan commands to clear the various caches:
Clear Application Cache:
php artisan cache:clear
Clear Route Cache:
php artisan route:clear
Clear Configuration Cache:
php artisan config:clear
Clear Compiled Views:
php artisan view:clear
Clear Compiled Classes:
php artisan clear-compiled
Rebuild Configuration Cache (Optional)
After clearing the configuration cache, you might want to rebuild it to improve performance:
php artisan config:cache
0 More Answers