Php.ini turning off an extension without commenting it out

Commenting out both lines is not optimal (should have inferred that from the post…). I am not loading an extension more than once. I want to either load an extension, or just not load it. But my php install includes MULTIPLE ini’s for different situations, with set priorities in a folder for includes. (your typical conf.d-type folder) and I would like to override previous included ini’s with later included ini settings.

Here is what is happening:

ini1
(original php ini, untouched)

ini2:

zend_extension="/wherever/you/put/it/xdebug.so"

ini3:

(something to disable the "  zend_extension="/wherever/you/put/it/xdebug.so" " line)

ini2 is a special static ini meant for a general set of servers. ini3 is meant for very specific servers and inherits the settings of ini2 (and ini1, the original) but I need to disable/turn off the loading of extensions for these servers.

And before it might be suggested, making a specific ini for the smaller server subset that needs ini3 is not optimal. It would require maintaining many more ini’s than my simple example is illustrating, and double checking that they all fit together well.

The only work around so far to stop an extension from being loaded on an earlier line is to point to the extension on a later line to a wrong path, which yields a php error on startup.

Things work nicely as long as a path isn’t involved in an ini setting. Setting a timezone in an earlier ini, and then changing it in a later ini, works as expected.