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 错误的更多相关文章
- php 环境require(): open_basedir restriction in effect 错误
php 环境require(): open_basedir restriction in effect 错误 错误日志显示,访问脚本不在 open_basedir的限定目录里面 解决方法打开fastc ...
- LNMP - Warning: require(): open_basedir restriction in effect错误解决方法
LNMP 1.4或更高版本如果不想用防跨目录或者修改.user.ini的防跨目录的目录还需要将 /usr/local/nginx/conf/fastcgi.conf 里面的fastcgi_param ...
- require(): open_basedir restriction in effect. 解决方法
在linux服务器部署thinkphp5的时候PHP报了这个错误, 如下: 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)
今天想把玩一下tp5,结果怎么都无法访问,每次都是报500错误,我把错误提示都打开看到下面的错误 require(): open_basedir restriction in effect. File ...
- require(): open_basedir restriction in effect. File
新安装的 lnmp 环境,将项目放上报 require(): open_basedir restriction in effect. File 的错误! 错误日志显示,访问脚本不在 open_base ...
- Warning: require(): open_basedir restriction in effect. File(/www/wwwroot/../thinkphp/start.php) is not within the allowed path(s):
Warning: require(): open_basedir restriction in effect. File(/www/wwwroot//../thinkphp/start.php) is ...
- 宝塔部署时,出现“open_basedir restriction in effect”错误
下面是错误代码: Warning: require(): open_basedir restriction in effect. Warning: require(XXXXXXXXXXX): fail ...
- tp5 宝塔open_basedir restriction in effect 错误; IIS open_basedir restriction in effect
很久前做过的一个微信项目,客户突然找到我说换了部署环境后网站报错,再跟客户确定了php版本,伪静态设置后,网站依旧打不开,官网手册这样解释: 然而因为客户是iis8的表示该文档一点鸡毛用都米有哇,求助 ...
- require(): open_basedir restriction in effect. File(/www/wwwroot/xcx/zerg/thinkphp/start.php) is not within the allowed path(s): (/www/wwwroot/xcx/zerg/public/:/tmp/:/proc/) in /www/wwwroot/xcx/zerg/p
解决方法: 在如下文件增加一项(如图所示) 在如下文件增加一项(如图所示): #php文件采用fastcgi解析并设置参数 location ~ \.php { try_files ...
随机推荐
- POJ 2566:Bound Found(Two pointers)
[题目链接] http://poj.org/problem?id=2566 [题目大意] 给出一个序列,求一个子段和,使得其绝对值最接近给出值, 输出这个区间的左右端点和区间和. [题解] 因为原序列 ...
- SQL 增删改查 复习
首先创建两张表 CREATE TABLE Teacher ( Id ,) NOT NULL PRIMARY KEY, Name ) NOT NULL, ); CREATE TABLE Student ...
- Java杂谈1——虚拟机内存管理与对象访问
1.理解JAVA虚拟机的内存管理 运行时的数据区 从java虚拟机的内存分配来看,一个java程序运行时包含了如下几个数据区: a) 程序计数寄存器(Program Counter Regis ...
- 【Linux】CentOS7上安装搜狗输入法
找到一篇资料,提供安装搜狗输入法的方法,在http://www.cnblogs.com/Yiutto/p/6204085.html[也是本文的参考原地址] 请大家自行下载fcitx.tar.gz 1. ...
- windows下如何添加、删除和修改静态路由
1.添加一条路由表 route add 192.168.100.0 mask 255.255.255.248 192.168.1.1 metric 3 if 2 1 2 添加一条路由记录,所有到192 ...
- hdu1048(c++)
用string串来处理这个题很方便 #include<iostream>#include<string>using namespace std;string cipher(st ...
- docker运行mysql
http://blog.csdn.net/u011492260/article/details/77970445 第一步: 安装Docker:首先到docker官网下载适合自己电脑当前系统的版本,并安 ...
- 响应头里的"Last-Modified"值是怎么来的?
1.如图所示,app.js文件得到的响应头的"Last-Modified"数值是:Mon, 09 Sep 2013 09:18:22 GMT 我们查看服务器上的app.js文件的修 ...
- python langid实现语种识别
2017-04-26 语料数据入库时有个小需求,需要用一个字段存储语料的语种,偶然发现langid可以实现这一功能,再次感叹python的好用! #coding=utf-8 import langid ...
- NeatBean下ssh 私钥格式问题
1. SecureCRT 生成的private key 的格式是其私有的格式, 2. 标准格式为 openssl 格式