Getting a Laravel application running well.
THE DEPLOYMENT SEQUENCE
- Pull the code.
- Install dependencies without development packages.
- Run migrations.
- Clear and rebuild caches.
- Verify.
THE CACHING COMMANDS
Configuration caching, route caching and view caching each improve performance measurably on production.
Cache them during deployment, and clear them when configuration changes. A cached configuration that no longer matches the .env file causes confusing behaviour.
OPCACHE
Ensure OPcache is enabled. It is the single largest performance gain available and costs nothing.
QUEUES
Process them with a cron job running the worker with a time limit, since persistent workers are not available on shared hosting.
LOGS
Laravel writes to storage/logs. These grow; configure rotation or clear them periodically, or they consume your disk quota.
STORAGE LINK
If you serve uploaded files, create the storage symlink. Without it, uploaded files are not reachable.
COMMON PROBLEMS
500 errors with no detail: check storage permissions and the log
Blank page: check the log, since debug is off