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