首页 > 代码库 > lnmp 环境require(): open_basedir restriction in effect 错误
lnmp 环境require(): open_basedir restriction in effect 错误
最近配置开发用的lnmp环境,环境配置完成后,爆500错误,查看nginx错误日志
open_basedir 将 PHP 所能打开的文件限制在指定的目录树,包括文件本身
错误日志显示,访问脚本不在 open_basedir的限定目录里面,配置open_basedir 一般会在php.ini 或 nginx 配置文件里面
首先检测php.ini 我发现并没有配置 open_basedir
然后检测nginx配置
发现 fastcgi.conf 中配置了open_basedir $document_root指向的是网站跟目录 /home/www/yii/web,我的项目用的是php2.0 框架需要解析 /home/www/yii 下面的php文件
由于我配置的是开发环境 ,简单粗暴就把fastcgi.conf 里面open_basedir给注释掉了,线上环境建议 把$document_root 更改为 需要解析的网站目录
然后就可以愉快的玩耍了
lnmp 环境require(): open_basedir restriction in effect 错误
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。