[shell]代码库
(require(): open_basedir restriction in effect. File(/............../thinkphp/start.php) is not within the allowed path(s)的解决办法
ThinkPHP5、Laravel等框架
配置nginx环境无法打开,500报错,打开 php.ini 报错提示
require(): open_basedir restriction in effect. File(/................../thinkphp/start.php) is not within the allowed path(s): (/...................../public/:/tmp/:/proc/)
ThinkPHP5
1,php.ini里面的 open_basedir 注释掉
2,修改fastcgi的配置文件 /usr/local/nginx/conf/fastcgi.conf
最后一行
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";
改为
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/../:/tmp/:/proc/";
保存
3,重启 service nginx restart
Laravel
报错
Warning: require(): open_basedir restriction in effect. File(/........
vim /usr/local/nginx/conf/fastcgi.conf
fastcgi_param PHP_ADMIN_VALUE"open_basedir=$document_root/:/tmp/:/proc/";
改成:
fastcgi_param PHP_ADMIN_VALUE "open_basedir=NULL";
重启 service nginx restart