PHP_EXTENSIONS environment variable does not install extensions at runtime #653
rdehnhardt
started this conversation in
Ideas & Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
The
PHP_EXTENSIONSenvironment variable is accepted by the container but does not actually install the specified extensions at startup.Environment
serversideup/php:8.5-fpm-nginxSteps to Reproduce
PHP_EXTENSIONS: "intl pcov"indocker-compose.dev.ymlenvironment:docker compose -f docker-compose.yml -f docker-compose.dev.yml up -dphp -m | grep pcov— extension is not loadedenv | grep PHP_EXTENSIONS— variable is presentExpected Behavior
Extensions listed in
PHP_EXTENSIONSshould be installed viainstall-php-extensionsduring container startup, similar to how other environment variables (e.g.,PHP_OPCACHE_ENABLE,PHP_MEMORY_LIMIT) are applied at runtime.Actual Behavior
The environment variable is set inside the container but the extensions are never installed. No error messages appear in the container logs. Manual installation with
install-php-extensions pcov(as root) works correctly.Workaround
Using a custom Dockerfile that bakes the extensions into the image:
Suggestion
It would be useful to have runtime extension installation via an environment variable (e.g.,
PHP_EXTENSIONS) that runsinstall-php-extensionsduring the container entrypoint, before the main process starts. This would allow developers to add extensions without maintaining a custom Dockerfile, especially useful in development environments where build time matters less than convenience.Beta Was this translation helpful? Give feedback.
All reactions