环境配置:centos 7 ; php 7.1.5

Warning: require(): open_basedir restriction in effect. File(/home/wwwroot/default/laravel/bootstrap/autoload.php) is not within the allowed path(s): (/home/wwwroot/default/laravel/public/:/tmp/:/proc/) in /home/wwwroot/default/laravel/public/index.php on line 22

Warning: require(/home/wwwroot/default/laravel/bootstrap/autoload.php): failed to open stream: Operation not permitted in /home/wwwroot/default/laravel/public/index.php on line 22

Fatal error: require(): Failed opening required '/home/wwwroot/default/laravel/public/../bootstrap/autoload.php' (include_path='.:/usr/local/php/lib/php') in /home/wwwroot/default/laravel/public/index.php on line 22

解决方法:

如果你是PHP 5.3.3以上的版本,可以修改/usr/local/php/etc/php.ini在末尾里加入:

[HOST=www.project.com]
open_basedir=/home/wwwroot/default/laravel/:/tmp/
[PATH=/home/wwwroot/default/laravel/public]
open_basedir=/home/wwwroot/default/laravel/:/tmp/

按上面的这个例子修改,换成你自己的域名和目录,多个网站就按上面的例子改成多个,最后重启php-fpm:/etc/init.d/php-fpm restart

上面路径地址 不需要到 public  里面

lnmp环境运行laravel open_basedir restriction in effect 问题的更多相关文章

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

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

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

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

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

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

  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. 解决方法

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

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

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

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

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

  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 EE学习笔记(七)

    MyBatis的核心配置 1.MyBatis的核心对象 1).SqlSessionFactory是MyBatis框架中十分重要的对象,它是单个数据库映射关系经过编译后的内存镜像,其主要作用是创建Sql ...

  2. Web Scalability for Startup Engineers Tip&Techniques for Scaling You Web Application --读书笔记

    Web Scalability for Startup Engineers Tip&Techniques for Scaling You Web Application 第1章和第2章讲述可伸 ...

  3. kafka基础六

    kafka中的高可用HA 1.replication副本 同一个partition会有一个leader和多个副本,这些副本存储的内容与leader相同,可以通过 server.properties 配 ...

  4. 前端常用的jquery代码

    主要是个人在工作中常用到的一些代码,会慢慢添加: 1).enter键时可以触发某些事件,比如登陆事件: $('#loginform').bind('keypress',function(event){ ...

  5. uvm_reg_defines——寄存器模型(四)

    文件: src/marcos/uvm_reg_defines 类: 无 该文件是寄存器模型src/reg/* 文件对于的宏文件,主要定义了寄存器地址位宽,寄存器数据位宽,字节的大小.计算机从最初的8, ...

  6. ios invalid put policy encoding 七牛上传报错

    获取七牛token的时候deadline不能为NSString类型 NSDictionary *infoDic = @{@"scope":@"yangtao", ...

  7. 对于exacoin虚拟币以及其他虚拟币乱象的思考

    今天晚上12点正,我帮两个朋友购买exacoin虚拟币,当然我也购买,为了购买我做了充分的准备,包括使用多个浏览器和准备良好的***代理,并转如足量BTC以支持购买,但是通过三天晚上的奋战,让我感觉这 ...

  8. socket的BeginConnect(EndPoint remoteEP,AsyncCallback callback,objcet state);个人理解

    1.socket.BeginConnect(); 其中的三个参数值EndPoint remoteEP,这个是用来指定连接的socket服务器的的地址 socket参数表 EndPoint remote ...

  9. abp viewmodel的写法

    我的写法 public class QuotaCreateOrEditViewModel { public QuotaDto LoanQuota { get; set; } public bool I ...

  10. Asp.Net Core 入门(九)—— 环境变量 TagHelper

    我们在之前讲Program.cs文件做了什么的时候,提到启动CreaeDefaultBuilder会获取环境变量来做一些判断之类的操作.那么我们的Taghelper也可以使用“ASPNETCORE_E ...