简体   繁体   中英

custom php.ini / php_value : which takes precedence?

We could override the default php.ini settings using the

PHPINIDir /var/www/web1

directive in <VirtualHost> decription.

But I have seen php_value statements which is applied to all the sites in the httpd.conf files. For example :

php_value upload_max_filesize somevalue

Will the general settings like above override the custom php.ini settings?

Pardon me that I don't have an environment to test this out at present.

PHP configuration precedence order is as follows:

  1. The php.ini
  2. The conf.d directory. On some distros, there is a modularized conf.d directory. values specified in there override php.ini
  3. The directive PHPINIDir /var/www/web1 replaces 1 and 2 with your custom php.ini
  4. Apache virtual host configuration. eg "php_value error_reporting " overrides any php.ini
  5. .htaccess files placed inside your webspace override the above configuration
  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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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