简体   繁体   English

自定义php.ini / php_value:哪个优先?

[英]custom php.ini / php_value : which takes precedence?

We could override the default php.ini settings using the 我们可以使用。覆盖默认的php.ini设置

PHPINIDir /var/www/web1

directive in <VirtualHost> decription. <VirtualHost>指令。

But I have seen php_value statements which is applied to all the sites in the httpd.conf files. 但我看到php_value语句应用于httpd.conf文件中的所有站点。 For example : 例如 :

php_value upload_max_filesize somevalue

Will the general settings like above override the custom php.ini settings? 上面的常规设置是否会覆盖自定义php.ini设置?

Pardon me that I don't have an environment to test this out at present. 请原谅我目前没有环境来测试这个问题。

PHP configuration precedence order is as follows: PHP配置优先顺序如下:

  1. The php.ini php.ini
  2. The conf.d directory. conf.d目录。 On some distros, there is a modularized conf.d directory. 在某些发行版中,有一个模块化的conf.d目录。 values specified in there override php.ini 在那里指定的值覆盖php.ini
  3. The directive PHPINIDir /var/www/web1 replaces 1 and 2 with your custom php.ini 指令PHPINIDir / var / www / web1用您的自定义php.ini替换1和2
  4. Apache virtual host configuration. Apache虚拟主机配置。 eg "php_value error_reporting " overrides any php.ini 例如“php_value error_reporting”会覆盖任何php.ini
  5. .htaccess files placed inside your webspace override the above configuration 放置在您的网站空间内的.htaccess文件会覆盖上述配置
  6. Source code values specified in the source code override all other configuration 源代码中指定的源代码值会覆盖所有其他配置

Some (security critical) options can only be set in higher level config files 某些(安全关键)选项只能在更高级别的配置文件中设置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM