用户注册



邮箱:

密码:

用户登录


邮箱:

密码:
记住登录一个月忘记密码?

发表随想


还能输入:200字
云代码 - shell代码库

require(): open_basedir restriction解决办法

2020-01-17 作者: 小蜜锋举报

[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


网友评论    (发表评论)


发表评论:

评论须知:

  • 1、评论每次加2分,每天上限为30;
  • 2、请文明用语,共同创建干净的技术交流环境;
  • 3、若被发现提交非法信息,评论将会被删除,并且给予扣分处理,严重者给予封号处理;
  • 4、请勿发布广告信息或其他无关评论,否则将会删除评论并扣分,严重者给予封号处理。


扫码下载

加载中,请稍后...

输入口令后可复制整站源码

加载中,请稍后...