[PHP-NOTES] note 130405 added to configuration.file

[email protected] ("[email protected]") Thu, 3 Jul 2025 22:39:08 +0000 (UTC)
Newsgroups php.notes
Message-ID <[email protected]>
It is worth noting that  $PHP_INI_SCAN_DIR is **not** recursive, which offers flexibility in organizing configuration in base-environment fashion:

$ mkdir -p /tmp/php_conf/prod /tmp/php_conf/dev 
$ touch /tmp/php_conf/php.base.ini /tmp/php_conf/prod/php.ini /tmp/php_conf/dev/php.ini
$ export PHP_INI_SCAN_DIR="/tmp/php_conf:/tmp/php_conf/dev"
$ php --ini
//...
Scan for additional .ini files in: /tmp/php_conf:/tmp/php_conf/dev
Additional .ini files parsed:      /tmp/php_conf/php.base.ini,
/tmp/php_conf/dev/php.ini

Such behavior can be used with docker where whole a subtree of configs is mounted into a dev-container, with ability to control which set of files is loaded using an environment variable.
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 2601:249:9482:a020:8c30:21f:b3b1:b188)
----
Manual Page -- https://php.net/manual/en/configuration.file.php
Edit        -- https://main.php.net/note/edit/130405
Del: integrated  -- https://main.php.net/note/delete/130405/integrated
Del: useless     -- https://main.php.net/note/delete/130405/useless
Del: bad code    -- https://main.php.net/note/delete/130405/bad+code
Del: spam        -- https://main.php.net/note/delete/130405/spam
Del: non-english -- https://main.php.net/note/delete/130405/non-english
Del: in docs     -- https://main.php.net/note/delete/130405/in+docs
Del: other reasons-- https://main.php.net/note/delete/130405
Reject      -- https://main.php.net/note/reject/130405
Search      -- https://main.php.net/manage/user-notes.php