thinkphp 5.0 lnmp环境下 无法访问,报错500(public目录)

两种方法:

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

 

posted @ 2018-04-03 15:09  反面東东  阅读(1115)  评论(0编辑  收藏  举报