最近配置开发用的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 错误的更多相关文章

  1. php 环境require(): open_basedir restriction in effect 错误

    php 环境require(): open_basedir restriction in effect 错误 错误日志显示,访问脚本不在 open_basedir的限定目录里面 解决方法打开fastc ...

  2. LNMP - Warning: require(): open_basedir restriction in effect错误解决方法

    LNMP 1.4或更高版本如果不想用防跨目录或者修改.user.ini的防跨目录的目录还需要将 /usr/local/nginx/conf/fastcgi.conf 里面的fastcgi_param ...

  3. require(): open_basedir restriction in effect. 解决方法

    在linux服务器部署thinkphp5的时候PHP报了这个错误, 如下: Warning: require(): open_basedir restriction in effect. File(/ ...

  4. 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 ...

  5. require(): open_basedir restriction in effect. File

    新安装的 lnmp 环境,将项目放上报 require(): open_basedir restriction in effect. File 的错误! 错误日志显示,访问脚本不在 open_base ...

  6. 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 ...

  7. 宝塔部署时,出现“open_basedir restriction in effect”错误

    下面是错误代码: Warning: require(): open_basedir restriction in effect. Warning: require(XXXXXXXXXXX): fail ...

  8. tp5 宝塔open_basedir restriction in effect 错误; IIS open_basedir restriction in effect

    很久前做过的一个微信项目,客户突然找到我说换了部署环境后网站报错,再跟客户确定了php版本,伪静态设置后,网站依旧打不开,官网手册这样解释: 然而因为客户是iis8的表示该文档一点鸡毛用都米有哇,求助 ...

  9. 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 ...

随机推荐

  1. 集合框架(04)HashMap

    集合Map的简单方法:该集合存储键值对,一对一对往里面存,而且要保证健的唯一性 1.添加 put(K key,V value) putAll(Map<? Extends k, ? extends ...

  2. 10.getter & setter

    自定义 Person 类 class Person: NSObject { var name: String? var age: Int? } getter & setter var _nam ...

  3. red-lang

    Red is a next-generation programming language strongly inspired by Rebol, but with a broader field o ...

  4. 非常老的话题 SQLSERVER连接池

    原文:非常老的话题 SQLSERVER连接池 非常老的话题 SQLSERVER连接池 写这篇文章不是说要炒冷饭,因为园子里有非常非常多关于SQLSERVER连接池的文章,但是他们说的都是引用MSDN里 ...

  5. BFS求最短路

    假设有一个n行m列的迷宫,每个单位要么是空地(用1表示)要么是障碍物(用0表示).如和找到从起点到终点的最短路径?利用BFS搜索,逐步计算出每个节点到起点的最短距离,以及最短路径每个节点的前一个节点. ...

  6. 深入理解dataset及其用法

    DataSet是ADO.NET的中心概念.可以把DataSet当成内存中的数据库,DataSet是不依赖于数据库的独立数据集合.所谓独立, 就是说,即使断开数据链路,或者关闭数据库,DataSet依然 ...

  7. 使用Spring boot整合Hive,在启动Spring boot项目时,报错

    使用Spring boot整合Hive,在启动Spring boot项目时,报出异常: java.lang.NoSuchMethodError: org.eclipse.jetty.servlet.S ...

  8. Exception thrown in catch and finally clause

    Based on reading your answer and seeing how you likely came up with it, I believe you think an " ...

  9. 如何在阿里云服务器搭建FTP服务器,在本地电脑连接并操作

    首先你需要有一个阿里云的ECS服务器 并且开通了公网宽带(话说也不贵,开来玩玩还是可以的,第一次买会比较便宜,第二次买1M的宽带两天是九毛多吧~) 开通了宽带之后,ECS服务器就可以上网了 如果嫌弃阿 ...

  10. 2017.8.5 Linux达人养成计划 I (上)

    参考来自:http://www.imooc.com/learn/175 1 linux简介 1.1 linux简介 linux分为了内核版本和发行版本. 二者的区别:内核版本是由官方提供,而不同的发行 ...