open_basedir restriction in effect,解决php引入文件权限问题
一、前言
今天在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引入文件权限问题的更多相关文章
- open_basedir restriction in effect,解决php引入文件权限问题 解决方法
如下: 出现问题的原因: 查看问题描述以及资料,发现是php open_basedir 配置的问题,PHP不能引入其授权目录上级及其以上的文件: 一般情况下是不会出现这种问题的,之所以出现这个问题绝大 ...
- php错误提示 open_basedir restriction in effect 解决
<VirtualHost *:80> DocumentRoot "D:/www/4w_raaaa_com_2017" ServerName www.raaaa.com: ...
- require(): open_basedir restriction in effect. 解决方法
在linux服务器部署thinkphp5的时候PHP报了这个错误, 如下: Warning: require(): open_basedir restriction in effect. File(/ ...
- open_basedir restriction in effect,解决php引入文件权限问题 lnmp
1.配置了虚拟域名 vim /usr/local/nginx/conf/vhost/siemens.conf server { listen 80; #listen [::]:80 default_s ...
- 使用宝塔配置laravel站点时,遇到open_basedir restriction in effect. 原因与解决方法
今天一位朋友在linux服务器部署thinkphp5的时候PHP报了这个错误,如下: Warning: require(): open_basedir restriction in effect. F ...
- 解决 php 报错 open_basedir restriction in effect或者nginx提示No input file specified怎么办
解决 php 报错 open_basedir restriction in effect或者nginx提示No input file specified怎么办 问题是出现在了PHP.INI上面了 ,原 ...
- LNMP - Warning: require(): open_basedir restriction in effect错误解决方法
LNMP 1.4或更高版本如果不想用防跨目录或者修改.user.ini的防跨目录的目录还需要将 /usr/local/nginx/conf/fastcgi.conf 里面的fastcgi_param ...
- PHPExcel中open_basedir restriction in effect的解决方法
用PHPExcel做导出execl的时候发现在本地没有问题,但是把网站传到租用的服务器的时候就报错,具体如下: Warning: realpath() [function.realpath]: ope ...
- 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. ...
随机推荐
- SpriteBuilder中锚点的一般用法
注意:改变节点的锚点(anchor point)将会影响缩放和旋转操作,也会影响边界边框和碰撞的检测. 锚点仅仅挪动节点的视觉表现,这种改变可能与物理表现不一致. 你绝不应该错误的挪动锚点去改变节点的 ...
- Oracle EBS ERP中月结年结的流程总结
月结与年结处理,是企业财务比较特殊而重要的业务操作.在实施与推广OracleERP系统过程中,如何结合现行的会计制度与惯例,充分利用软件功能,做好相应的关账.开账工作,是困扰许多企业财务人员乃至实施顾 ...
- 如果去掉UITableView上的section的headerView和footerView的悬浮效果
项目需要cell的间距,又不需要悬浮效果,百度之后找到这个方法,记录一下,备忘. 用UIScrollView的代理方法实现 - (void)scrollViewDidScroll:(UIScrollV ...
- Android源代码目录组成介绍-android学习之旅(97)
android的主要源代码组成如下: Kernel:Android Linux 内核2.6 bionic:Android 标准C运行支持库 bootloader:内核加载器参考 build:Andro ...
- IOS微信分享功能简单实现
PS:此文以简单实现功能为主,不足之前还望指点,大神勿喷. 在此之前如何申请微信认证的Key就不说了,公司一般会有人搞 1.首先下载微信SDK:微信SDK下载地址(更多关于微信SDK信息文档请访问官方 ...
- windows from 手风琴
public class OutlookBar : Panel { private int SelectedBandHeight { get; set; } public int ButtonHeig ...
- Cloud Carousel
<div class="carousel1" id="carousel1" > <a href="#"><im ...
- java中文拼音字母排序
package com.yputil.util; import java.text.CollationKey;import java.text.Collator;import java.util.Ar ...
- dom4j 解析 xml标签属性
重写onEnd()和onStart()方法 public class XmlElementHandler implements ElementHandler { @Override public vo ...
- 一个基础的for循环面试题
下面的这段程序主要考察的就是for循环的基础,输出什么?????? [html] view plaincopyprint? public class test { /** * @param args ...