Apache/PHP: Runtime Configuration

Explains how to define the PHP_INI_SCAN_DIR environmental variable –
by initialization of the environment for the user which runs the apache2 daemon.

It’s the same as the PHP “./configure –with-config-file-scan-dir” parameter – but at runtime.

So there is no need to recompile PHP only because changing the INI file location –
While I rather had the initial problem, that the parameter wasn’t picked up at compile time.

One has to stop the daemon in the first place:

service httpd stop

… and then edit the configuration file:

nano /etc/sysconfig/httpd

In order to define an additional PHP initialization directory to scan:

export PHP_INI_SCAN_DIR=/etc/php-zts.d

Then restart the daemon again:

service httpd start

That directory should now be listed under “Scan this dir for additional .ini files”:

<?php phpinfo(); ?>