一、前言

    今天在Ubuntu安装了lnmp环境,运行项目的时候出现了,引入500的错误

二、查看错误

  再项目文件入口添加,代码显示错误内容,查看到一下错误

 ini_set('display_errors','yes');

  

三、分析错误内容

  查看问题描述以及资料,发现是php open_basedir 配置的问题,php不能引入其授权目录上级及其以上的文件,默认配置在php.ini(/usr/local/php/etc/php.ini),但是我的open_basedir 并没有配置,默认被注释了。

文献说可能在服务器配置目录下,如nginx、Apache等,于是用户sublime打开nginx进行全局搜索,open_base,果真还是搜到了,如下图

  

四、修改配置

  line 27 是默认配置,默认配置是nginx.conf root 文件下的权限目录

  line 27 我复制了一行改了授权目录  改成了项目文件夹的上级,重启nginx,项目可以打开了。

五、总结

  就是open_basedir 配置项的文件权限问题,如果你们也遇到了这样的情况,把php.ini 服务器nginx、Apache的配置文件都检查下。

open_basedir restriction in effect,解决php引入文件权限问题的更多相关文章

  1. open_basedir restriction in effect,解决php引入文件权限问题 解决方法

    如下: 出现问题的原因: 查看问题描述以及资料,发现是php open_basedir 配置的问题,PHP不能引入其授权目录上级及其以上的文件: 一般情况下是不会出现这种问题的,之所以出现这个问题绝大 ...

  2. php错误提示 open_basedir restriction in effect 解决

    <VirtualHost *:80> DocumentRoot "D:/www/4w_raaaa_com_2017" ServerName www.raaaa.com: ...

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

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

  4. open_basedir restriction in effect,解决php引入文件权限问题 lnmp

    1.配置了虚拟域名 vim /usr/local/nginx/conf/vhost/siemens.conf server { listen 80; #listen [::]:80 default_s ...

  5. 使用宝塔配置laravel站点时,遇到open_basedir restriction in effect. 原因与解决方法

    今天一位朋友在linux服务器部署thinkphp5的时候PHP报了这个错误,如下: Warning: require(): open_basedir restriction in effect. F ...

  6. 解决 php 报错 open_basedir restriction in effect或者nginx提示No input file specified怎么办

    解决 php 报错 open_basedir restriction in effect或者nginx提示No input file specified怎么办 问题是出现在了PHP.INI上面了 ,原 ...

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

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

  8. PHPExcel中open_basedir restriction in effect的解决方法

    用PHPExcel做导出execl的时候发现在本地没有问题,但是把网站传到租用的服务器的时候就报错,具体如下: Warning: realpath() [function.realpath]: ope ...

  9. open_basedir restriction in effect. File() is not within the allowed path(s)

    目前发现eaccelerator安装之后如果php.ini中设置open_basedir将导致open_basedir的一些报错(open_basedir restriction in effect. ...

随机推荐

  1. C/C++内存布局及对齐

    1.源文件转换为可执行文件 源文件经过以下几步生成可执行文件: 1.预处理(preprocessor):对#include.#define.#ifdef/#endif.#ifndef/#endif等进 ...

  2. IP的种类与获取方式

    IP 的种类与取得方式 接下来要跟大家谈一谈也是很容易造成大家困扰的一个部分,那就是 IP 的种类!很多朋友常常听到什么『真实IP, 实体 IP, 虚拟 IP, 假的 IP....』烦都烦死了-其实不 ...

  3. Linux - gcc 的简易用法 (编译、参数与链结)

    # 仅将原始码编译成为目标档,并不制作连结等功能: [root@www ~]# gcc -c hello.c # 会自动的产生 hello.o 这个文件,但是并不会产生 binary 运行档. # 在 ...

  4. MVVM With ReactiveCocoa让移动开发更简单

    作者:@雷纯锋2011 MVVM是一种软件架构模式,它是 Martin Fowler 的 Presentation Model 的一种变体,最先由微软的架构师 John Gossman 在 2005 ...

  5. MongoDB之Java测试代码(DAO层)

    MongoInit.java是数据库初始化及连接类 MongoUtils.java是对mongodb的各种操作方法 MongoInit.java package com.wlwcloud.datate ...

  6. 本人在CSDN上的技术博客访问量突破了10万次,特此截图留念

                从 2011-11-16在CSDN开博至今,将近三年.  在近三年的时间里,本博的访问量于2014-07-01突破了10万次,单篇博文<软件开发高手须掌握的4大SQL精髓 ...

  7. 关于Block的使用和5点注意事项

    一.概念 首先需要了解的是Block是一个代码块,是一个变量的形式存在的. 二.构成了解 我们需要在函数中声明block,因为是变量的形式,而且存在静态变量形式 类型1:  NSString* (^b ...

  8. Mac OS X下各种文件编码的转换方法

    何曾几时本猫还在windows下编码的时候,那时ruby的源代码的编码格式都是gbk啊!导致N多中文显示为乱码.后来无奈写了个转换代码从gbk编码转为utf-8格式的小工具: #!/usr/bin/r ...

  9. c#调用野狗云 rest api

    野狗云就不多介绍了,这里主要是记录一下c#调用他们提供的rest api,把数据post到野狗云存储,直接上代码 static void Main(string[] args) { string st ...

  10. intersection of two linked lists.(两个链表交叉的地方)

    Write a program to find the node at which the intersection of two singly linked lists begins. For ex ...