Open_basedir PHP Licensing Directory settings

Source: Internet
Author: User

PHP for security reasons, there is a open_basedir setting. Depending on your Web server environment, Open_basedir can be set up in several places.

First, configure it in php.ini.

; Open_basedir =

If a semicolon is found before the configuration item, it indicates that the setting is not in php.ini. It is likely that it was configured in the fastcgi.conf in PHP-FPM. The configuration in PHP-FPM overrides the php.ini configuration.

" open_basedir= $document _root:/tmp/:/proc/:/you_web_path ";
/you_web_path is the path you want to add to allow PHP access. Multiple paths directly separated by semicolons


If you also have multiple projects for the server, either in php.ini or Fastcgi.cong, it is for all projects. Can you just set it up for a project?
The answer is yes. You can also configure it through the. User.ini in the project root directory .
. User.ini Configuration
First, to make the. User.ini effective, set the php.ini in the
User_ini.filename = ". User.ini" User_ini.cache_ttl = 300

For the meaning of these two configurations, see the PHP manual http://php.net/manual/zh/configuration.file.per-user.php

Comment out the configuration of the Open_basedir in fastcgi.conf.

Create the. user.ini file in the project root directory and write the following

Open_basedir=/tmp/:/proc/:/you_web_path
/you_web_path is the path you want to add to allow PHP access. Multiple paths directly separated by semicolons
Restart the PHP-FPM service.

Open_basedir PHP Licensing Directory settings

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.