When a fresh Laravel 13 project installs but fails in Docker, capture the exact exception before changing dependencies. Then confirm that the PHP process serving the application is the same runtime Composer checked and that it satisfies Laravel 13 requirements.
Last updated: November 15, 2026.
docker compose exec app php -v
docker compose exec app php -m
docker compose exec app composer check-platform-reqs
docker compose exec app php artisan --version
docker compose exec app php artisan about
docker compose logs --tail=200 appRun the commands in the application container, not only on the host. Replace app with the PHP service name from your Compose file, and keep the first complete exception and stack trace.
Check versions before debugging application code
Laravel’s deployment requirements specify PHP 8.3 or newer for Laravel 13 and list the required PHP extensions. composer check-platform-reqs compares the installed packages with the runtime that executes the command. Also inspect the web or FPM container because a CLI container can have different extensions or configuration.
If the project was created with the Laravel installer, follow the Laravel 13 upgrade guide and update the installer before generating another test project. Do not work around a platform error with --ignore-platform-reqs; that permits installation without making the missing runtime capability available.
Separate container problems from framework problems
Confirm that .env exists, APP_KEY is set, writable directories are owned by the PHP user, and database and cache host names use Compose service names rather than localhost. Confirm the mapped application port is the port the container actually listens on. Clear generated configuration only after correcting the environment: php artisan optimize:clear.
Compare the failure against the Laravel log and container log. A connection refusal, permission error, missing extension, or stale cached setting requires a different fix. Record the Laravel, PHP, Composer, image, and database versions with the exception. If Laravel 12 works in the same image, compare dependency and extension requirements rather than assuming the framework itself is defective.