两种方法:

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]
open_basedir=/home/wwwroot/
xxx.abczn.com:/tmp/:/proc/
[PATH=/home/wwwroot/
xxx.abczn.com]
open_basedir=/home/wwwroot/
xxx.abczn.com:/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

 

相关文章:

  • 2021-09-09
  • 2021-11-27
  • 2022-12-23
  • 2021-12-30
  • 2021-05-27
  • 2021-07-04
  • 2022-12-23
  • 2021-10-18
猜你喜欢
  • 2021-12-07
  • 2021-09-12
  • 2021-07-26
  • 2021-08-03
  • 2022-01-24
相关资源
相似解决方案