遇到is not within the allowed path(s)报错解决办法

Published on with 0 views and 0 comments
  • PHP 版本:PHP7.x
  • 报错信息:[error] 22332#0: *3 FastCGI sent in stderr: "PHP message: PHP Warning: require(): open_basedir restriction in effect. File(xxxx) is not within the allowed path(s):
  • 问题排查:发现不是目录下的.user.ini文件的问题,也不是php.ini的配置问题,是fastcgi.conf的配置问题

解决方案:修改fastcgi.conf配置,找到fastcgi_param PHP_ADMIN_VALUE,修改为以下内容

fastcgi_param PHP_ADMIN_VALUE "open_basedir=/home/wwwroot/:/tmp/:/proc/";

上面的/home/wwwroot/是Nginx的根目录的绝对路径。


标题:遇到is not within the allowed path(s)报错解决办法
作者:M1d3r
地址:https://shaobin.wang/articles/2021/02/05/1612520554183.html