环境配置: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. linux ln -s 软链接

     一.创建 ln -s 源文件 目标文件 当我们需要在不同的目录,用到相同的文件时,我们不需要在每一个需要的目录下都放一个必须相同的文件,我们只要在某个固定的目录,放上该文件,然后在其它的目录下用ln ...

  2. CentOS7.2 安装iptables

    1  先检查是否安装了iptables: service iptables status iptables  -L ls /etc/sysconfig/ 综上:命令报错,且 iptables不存在,那 ...

  3. Oracle 恢复数据后,数据库中中文变成问号解决方法

    1.右击---我的电脑---环境变量 2.新增环境变量 变量名:LANG=zh_CN.GBK NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK 3.重启PLSQL或 ...

  4. SpringMVC之 HandlerAdapter和handlerMapping

    HandlerAdapter字面上的意思就是处理适配器,它的作用用一句话概括就是调用具体的方法对用户发来的请求来进行处理.当handlerMapping获取到执行请求的controller时,Disp ...

  5. plpgsql: 动态插入数据 1

    --目标:1.建立一个函数实现 输入一个表名(tableName)tableName,一个JSON串{feildName1:feildVale1,feildName2:feildVale2} -- 然 ...

  6. DVWA之跨站请求伪造(CSRF)

    CSRF全称是Cross site request forgery ,翻译过来就是跨站请求伪造. CSRF是指利用受害者尚未失效的身份认证信息(cookie,会话信息),诱骗其点击恶意链接或者访问包含 ...

  7. 线程池 Threadlocal 使用注意

    线程池中的线程是重复使用的,即一次使用完后,会被重新放回线程池,可被重新分配使用. 因此,ThreadLocal线程变量,如果保存的信息只是针对一次请求的,放回线程池之前需要清空这些Threadloc ...

  8. COGS 2211. [BZOJ3653]谈笑风生

    ★★★★   输入文件:laugh.in   输出文件:laugh.out   简单对比时间限制:3 s   内存限制:512 MB [问题描述] 设T 为一棵有根树,我们做如下的定义: • 设a和b ...

  9. ubuntu 16.04 国内源安装docker

    1. 通过curl命令安装 检查是否安装curl root@ros-OptiPlex-3050:~# which curlroot@ros-OptiPlex-3050:~# 更新安装 root@ros ...

  10. Xcode5 如何添加一个Github/Repository 并且Checkout

    1. 添加一个Account  也就是添加一个 Repository. In Xcode, choose Xcode > Preferences, and click Accounts. Pre ...