一、前言

    今天在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. java 调用JRuby

    1.core package vanilla; import org.jruby.embed.ScriptingContainer; public class HelloWorld { private ...

  2. nexus安装

    nexus 快速安装指南 1)下载 nexus-2.9.2-01-bundle.zip 地址: http://www.sonatype.org/nexus/ 2)解压 redhat服务器:/opt下面 ...

  3. 如何设置静态IP

    首先在CMD命令行ipconfig查看临时分配的IP地址: 然后打开我的"网络"--->"本地连接"--->IPv4--->属性 电信DNS劫 ...

  4. AOP的相关概念

  5. jQuery插件学习基础

    1.给jQuery添加全局的函数: $.zgz={  fn1:function(){ alert('我是刚设置的第一个全局函数') },fn2:function(){ alert('我是刚设置的第二个 ...

  6. mysql海量数据的优化

    转载:https://www.cnblogs.com/trying/archive/2013/08/15/3259126.html 下面是一部分比较重要的建议:1.选择正确的存储引擎以 MySQL为例 ...

  7. Roman to Integer(将罗马数字转成整数)

    Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 t ...

  8. 大数据征信的应用和启示:ZestFinance的基于大数据的信用评估技术

    http://www.d1net.com/bigdata/news/325426.html 2014年11月,本文作者有机会和ZestFinance的创始人和首席执行官梅里尔(Douglas C.Me ...

  9. websocket通信 实现java模拟一个client与webclient通信

    发文原由: 熟悉socket通信的同学,对于socket模拟server与client,实现相互通信, 或者使用websocket与java模拟的websocket服务器通信(比如一个聊天室),对于这 ...

  10. 使用ASP.NET SignalR实现一个简单的聊天室

    前言 距离我写上一篇博客已经又过了一年半载了,时间过得很快,一眨眼,就把人变得沧桑了许多.青春是短暂的,知识是无限的.要用短暂的青春,去学无穷无尽的知识,及时当勉励,岁月不待人.今天写个随笔小结记录一 ...