如何在另一个php.ini文件中包含一个php.ini文件? [英] How do I include a php.ini file in another php.ini file?
问题描述
如何在另一个php.ini文件中添加php.ini文件?
How do I include a php.ini file in another php.ini file?
推荐答案
可以包含来自主php.ini文件的.ini文件。
I don't think you can "include" .ini files from the main php.ini file.
一个可能的解决方案可能是在编译PHP时在配置行使用这个选项:
One possible solution, though, might be to use this option on the configure line, when compiling PHP :
--with-config-file-scan-dir=PATH
Set the path where to scan for configuration files
如果在编译时使用此选项,PHP将在此文件中查找每个.ini文件目录,除了正常php.ini文件。
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.
我想这是什么使用Ubuntu,例如,使用不同的.ini文件
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.
在配置行中使用此选项定义的php.ini文件的路径:
The path to the php.ini file being defined with this option, on the configure line :
--with-config-file-path=PATH
Set the path in which to look for php.ini [PREFIX/lib]
仍然,这可能意味着你必须重新编译PHP - ,btw - 最困难的部分是获得你需要的依赖。
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.
而且,这里是一个内部的帖子@ mailling-list说, do:配置文件和 PHP_CONFIG_FILE_SCAN_DIR
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
这篇关于如何在另一个php.ini文件中包含一个php.ini文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!