Enhanced Functions of virtual hosts in Nginx + PHP5.3

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.