If you are using Nginx and use multiple websites on one server, you may be worried about the security of the server and may feel that Nginx + php is not suitable for the deployment of multiple sites.
There is no restriction on open_basedir for Apache php_admin_value, and there is no. htaccess custom for php. ini.
PHP5.3 makes up for this in a timely manner, and many system administrators may not be aware of it. php5.3 has built-in support for software apache such as nginx:
Use [PATH] and [HOST] to customize php. ini
Example:
The Code is as follows: |
Copy code |
[HOST = www.hzhuti.com] Open_basedir =/var/www/www.hzhuti.com:/tmp [PATH =/var/www. bKjia. c0m] Open_basedir =/var/www. bKjia. c0m:/tmp [PATH =/var/www/www.bKjia.c0m.com] Open_basedir =/var/www. bKjia. c0m:/tmp
|
This configuration item can be placed in php. ini to isolate permissions between hosts.
Notice: these settings only take effect in CGI/FastCGI, and the extension and zend_extension commands cannot be set.
. User. ini support
According to the PHP manual, php will start scanning layers from the current PHP script directory in CGI/FastCGI mode until it reaches $ _ SERVER ['document _ root']. Only the current directory is scanned unless the script is executed outside DOCUMENT_ROOT.
After reading. user. ini, it will be cached. The time for re-reading is determined based on user_ini.cache_ttl. The default value is 5 minutes.
However, PHP_INI_SYSTEM cannot be set in. user. ini.