"how do i include a php.ini file in another php.ini file?" Answer’s


I don't think you can "include" .ini files from the main php.ini file.

One possible solution, though, might be to use this option on the configure line, when compiling PHP :

    Set the path where to scan for configuration files

If this option is used at compile-time, PHP will look for every .ini file in this directory, in addition to the "normal" php.ini file.

I suppose this is what is used by Ubuntu, for instance, which uses a different .ini file for each downloaded extension, instead of modifying php.ini.

The path to the php.ini file being defined with this option, on the configure line :

    Set the path in which to look for php.ini [PREFIX/lib]

Still, it probably means you'll have to re-compile PHP -- which is not that hard, btw -- the hardest part being to get the dependencies you need.

And, here is a post on the internals@ mailling-list that says the same thing as I do : config files and PHP_CONFIG_FILE_SCAN_DIR

Wednesday, March 31, 2021
answered 10 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :