How do I include a php.ini file in another php.ini file?(如何在另一个 php.ini 文件中包含一个 php.ini 文件?)
问题描述
如何在另一个 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 文件,除了正常"的 .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 文件,而不是修改 php.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 is 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 —— 这并不难,顺便说一句 —— 最难的部分是获得所需的依赖项.
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.
而且,这里有一篇关于 internals@ mailling-list 的帖子,和我说的一样:配置文件和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 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在另一个 php.ini 文件中包含一个 php.ini 文件?
基础教程推荐
- phpmyadmin 错误“#1062 - 密钥 1 的重复条目‘1’" 2022-01-01
- 在 CakePHP 2.0 中使用 Html Helper 时未定义的变量 2021-01-01
- 找不到类“AppHttpControllersDB",我也无法使用新模型 2022-01-01
- 使用 PDO 转义列名 2021-01-01
- PHP 守护进程/worker 环境 2022-01-01
- 如何在 XAMPP 上启用 mysqli? 2021-01-01
- 在 yii2 中迁移时出现异常“找不到驱动程序" 2022-01-01
- 如何在 Symfony 和 Doctrine 中实现多对多和一对多? 2022-01-01
- HTTP 与 FTP 上传 2021-01-01
- Doctrine 2 - 在多对多关系中记录更改 2022-01-01