PHP:如何更改PHP_INI_ *模式

I have a question about how to set PHP_INI_* modes and where to set them. I found this link about from http://php.net/manual/en/configuration.changes.modes.php. It says there are mode PHP_INI_USER, PHP_INI_ALL, PHP_INI_SYSTEM, PHP_INI-PERDIR. The user notice below says that Apache have several directives to change PHP_INI_* mode configuration, but I can't find these directives in httpd.conf. Which Apache configuration files are they in? For example, can I change configuration mode from PHP_INI_SYSTEM TO PHP_INI_USER? How can I do that?

Whether you can set a php_ini per user or per dir level depends on multiple conditions:

  • The php_ini directive itself. Refer to the documentation of the specific ini directive to know if it is allowed to set per user or per dir or whatever

  • The value of the directive user_ini.filename If it is omitted or empty, then setting php_ini directives per user level isn't possible. Thats because PHP does not know where to search for that user.ini files

  • When in apache conf php_ini directives can be set per directory inside a <directory> tag, or in a .htaccess following the syntax described here. Also note that the (apache) AllowOveride settings for this directories MUST be set to either AllowOverrideOptions or AllowOverrideAll in order to do so.

I have no idea how you managed not to find them ;)
http://php.net/manual/en/configuration.changes.php <- this link is the next one to yours on the left column of the man page