Environment Variable based PHP Extension loading

From: Date: Fri, 12 Sep 2025 20:13:04 +0000
Subject: Environment Variable based PHP Extension loading
Groups: php.internals 
Request: Send a blank email to internals+get-128687@lists.php.net to get a copy of this message
Hey,

I would like to load PHP extensions by environment variables in a
containerized environment. All existing solutions are moving files in an
entrypoint and this does not work for read-only containers. Why this?
Extensions like Blackfire/XDebug/OpenTelemetry/Tideways do not like each to
run at the same time, and having to build less containers simplifies a lot.

It's already possible to use environment variables in the php.ini like so:

extension=${PHP_PROFILER}

So it's possible to toggle the extensions already, the only thing that is
not working is passing an empty string (I don't want any profiler). Then we
get warnings like: Warning: PHP Startup: Unable to load dynamic library '"

Therefore I opened a pull request to ignore extension entries with empty
strings, so this works with that case too. Looking for feedback in the pull
request https://github.com/php/php-src/pull/19816

Thanks!


Thread (4 messages)

« previous php.internals (#128687) next »