Upgrade to v4
Version 4 adds the FrankenPHP variation and more environment variables. Most apps need no changes, but check the four below before you update your tag.
Changes to check
| Change | Likelihood of impact | You're affected if |
|---|---|---|
PHP-FPM uses ondemand behind a web server | Low | You tuned PHP_FPM_PM_* for dynamic on fpm-nginx or fpm-apache |
Laravel automations run php artisan optimize | Low | You set AUTORUN_ENABLED=true and rely on the individual cache commands |
| Automations stop the container when Laravel is missing | Medium | You set AUTORUN_ENABLED=true on a container without artisan and vendor/ |
The unit variation was removed in v4.1.0 | High for Unit users | You use a -unit tag |
PHP-FPM uses ondemand behind a web server
PHP_FPM_PM_CONTROL now defaults to ondemand on fpm-nginx and fpm-apache, which starts PHP-FPM workers only when requests arrive. The fpm variation still defaults to dynamic. Set PHP_FPM_PM_CONTROL=dynamic to keep the v3 behavior.
Laravel automations run php artisan optimize
With AUTORUN_ENABLED=true, the automations now run php artisan optimize instead of each cache command on its own. Turn off one cache with its variable, such as AUTORUN_LARAVEL_ROUTE_CACHE=false. On Laravel 11.38.0 and later that becomes optimize --except. See Laravel automations.
Automations stop the container when Laravel is missing
In v3, the automations were skipped silently when artisan wasn't found. In v4, a container with AUTORUN_ENABLED=true exits with an error unless APP_BASE_DIR has both artisan and a vendor directory. It also exits when AUTORUN_LARAVEL_MIGRATION_ISOLATION=true and Laravel is older than 9.38.0. Run composer install when you build the image, or set AUTORUN_ENABLED only on containers that have your app. v5 adds AUTORUN_LARAVEL_SKIP_IF_NOT_FOUND=true to skip instead.
The unit variation was removed in v4.1.0
NGINX archived the Unit project, so v4.1.0 and later don't build the unit variation. Existing -unit tags still pull but are no longer updated. See Unit for how to move to another variation.
New features
- FrankenPHP variation on Debian and Alpine, with a health check and environment variable configuration. See FrankenPHP.
- More Laravel automation options: migration modes (
fresh,refresh), a database connection, seeding, andAUTORUN_DEBUG. - More environment variables for PHP, OPcache, NGINX, Apache, and FrankenPHP, such as
NGINX_HTTP_PORT,NGINX_CLIENT_MAX_BODY_SIZE, andPHP_OPCACHE_VALIDATE_TIMESTAMPS. See the environment variable reference. - IPv6 for NGINX with
NGINX_LISTEN_IP_PROTOCOL(all,ipv4, oripv6). - Faster health checks at startup with
--start-periodand--start-interval. - Health checks stay out of the access logs on
fpm-nginxandfpm-apache. docker-php-serversideup-set-file-permissionsdetects the variation and accepts extra directories with--dir.- Apache access logs include the referrer and user agent.
- NGINX sets
absolute_redirect off;, handlessvgzwith Symfony's asset mapper, and lets PHP generaterobots.txt.
Update your tag
services:
php:
image: serversideup/php:8.5-fpm-nginx
ports:
- "80:8080"
This is a floating v5 tag. To stop at v4, use a version-pinned tag such as 8.5-fpm-nginx-v4.5.3, then read Upgrade to v5 before you move on.