两种方法:
1.修改fastcgi的配置文件 /usr/local/nginx/conf/fastcgi.conf
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/../:/tmp/:/proc/";
2.这个时候需要在php.ini下面添加如下内容
注: xxx.abczn.com 替换成你对应的域名和目录
[HOST=
xxx.abczn.com]
xxx.abczn.com
open_basedir=/home/wwwroot/:/tmp/:/proc/
xxx.abczn.com
[PATH=/home/wwwroot/]
xxx.abczn.com
open_basedir=/home/wwwroot/:/tmp/:/proc/
thinkphp 5.0 lnmp环境下 Warning: require(): open_basedir restriction in effect. File 报错处理
thinkPHP5配置nginx环境无法打开(require(): open_basedir restriction in effect. File(/mnt/hgfs/root/tp5/thinkphp/start.php) is not within the allowed path(s)
PHP7 有可能需要修改的 php.ini scandir
原文地址:https://www.cnblogs.com/18JG23/p/8708609.html
时间: 2024-10-27 03:58:16