php phpinfo() 主值和本地值的区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3335187/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
phpinfo() difference between master and local value
提问by Elzo Valugi
I have a clean install of a CentOs with php 5.2.13. In php.ini that is loaded and present in the header of phpinfo() I have
我使用 php 5.2.13 全新安装了 CentOs。在 php.ini 中加载并出现在 phpinfo() 的标题中,我有
safe_mode=off
in the phpinfo() information I have
在 phpinfo() 信息中我有
// local value - safe_mode: On
// master value - safe_mode: off
the php file has only a phpinfo() function. I am still looking for vhost file to see if any directives are there overwriting this, but still then any sugggestions?
php 文件只有一个 phpinfo() 函数。我仍在寻找 vhost 文件以查看是否有任何指令覆盖了它,但仍然有任何建议吗?
采纳答案by Elzo Valugi
I found the problem/solution to be in the extra config file that is added in the vhosts folder. The file is named httpd.include and it has this line
我发现问题/解决方案位于 vhosts 文件夹中添加的额外配置文件中。该文件名为 httpd.include 并且有这一行
php_admin_flag safe_mode on
PS. I really hate when other systems create files on the fly like this, especially with values they want.
附注。我真的很讨厌其他系统像这样即时创建文件,尤其是他们想要的值。
回答by m1tk4
Look for "Additional ini files parsed" in phpinfo() output. This setting can also be changed in the Apache config (including .htaccess files).
在 phpinfo() 输出中查找“已解析的其他 ini 文件”。也可以在 Apache 配置(包括 .htaccess 文件)中更改此设置。
回答by Alexander Yanovets
"Master Value" (from php.ini) could be overridden with "Local Value" in httpd.conf, .htaccessor other Apache configuration with php_valuedirective.
“主值”(来自 php.ini)可以在httpd.conf、.htaccess或其他带有php_value指令的Apache 配置中被“本地值”覆盖。

