Warning: require(): open_basedir restriction in effect. File(/home/www/blog/vendor/autoload.php) is not within the allowed path(s): (/home/www/blog/public/:/tmp/:/proc/) in /home/www/blog/public/index.php on line 25

Warning: require(/home/www/blog/vendor/autoload.php): failed to open stream: Operation not permitted in /home/www/blog/public/index.php on line 25

Fatal error: require(): Failed opening required '/home/www/blog/public/../vendor/autoload.php' (include_path='.:/usr/local/php/lib/php') in /home/www/blog/public/index.php on line 25

自己的laravel项目一直报错,很惆怅,网上的答案

排查php一定要打开  display_errors

、分析错误内容

  查看问题描述以及资料,发现是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 报错的更多相关文章

  1. 宝塔面板搭载yii2.0项目关于open_basedir报错解决办法

    昨天配置完宝塔的lamp后,然后把原本的yii项目放上去,发现出现三个报错,就是大概  require openssl之类的三个错误 然后去宝塔的界面里去配置了一个端口,然后再去阿里云上开放这个端口 ...

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

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

  3. lnmp 系统500 报错

    分析点: 1 文件目录权限不足 如果日志缓存目录没有写入权限 chmod -R 775 目录 2 lnmp 一键安装包 查看.user.ini ,其中open_basedir  不要设置到public ...

  4. [Linux]lnmp一键安装包,访问yii/tp5/laravel的时候,报错500或者空白页面

    当你将默认的访问路径改后(nginx.conf中的root 之后的路径),同时应该将/home/wwwroot/default/.user.ini 中的路径也改了! .user.ini 是隐藏文件,需 ...

  5. TP5报错总结

    LNMP一键安装包上部署TP5项目500错误或者空白解决 [问题原因] TP5的入口文件在public下,当他调用类文件时,跨目录所以造成500错误,或者一片空白的问题 [解决方法] 1.public ...

  6. thinkphp5报错

    thinkPHP5配置nginx环境无法打开(require():open_basedirrestrictionineffect.File(/mnt/hgfs/ro (2018-07-19 22:05 ...

  7. thinkphp 5.0 lnmp环境下 无法访问,报错500(public目录)

    两种方法: 1.修改fastcgi的配置文件 /usr/local/nginx/conf/fastcgi.conf fastcgi_param PHP_ADMIN_VALUE "open_b ...

  8. 打开nginx配置的站点报错500

    打开站点报错500的原因 有很多,这里只说明一点:nginx 的fastcgi.conf配置引起的问题 环境说明 1 站点目录结构 wwwroot website public application ...

  9. Unknown: o pen_basedir restriction in effect. File(XXX) is not within the allo wed path(s): (XXX:/tmp/:/proc/) in Unknown on line 0报错解决

    报错: [error] 12321#0: *92386 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: open_ba ...

随机推荐

  1. Android SwipeSelector

     Android SwipeSelector Android SwipeSelector是github上一个第三方开源的项目,其项目主页:https://github.com/roughike/S ...

  2. Thinkphp5.0 的使用模型Model查询

    Thinkphp5.0 的使用模型Model查询 一.查询多条记录 获取多个数据可以使用:select()方法和all()方法. 示例一:使用all()方法. //(1)筛选条件使用闭包函数 $res ...

  3. SQL SERVER代理作业删除失败问题

    在SQL Server 2005上遇到了先删除已运行维护计划后,再删除代理中由其产生的作业时,提示删除失败.   DELETE 语句与 REFERENCE 约束"FK_subplan_job ...

  4. Servlet实现国际化

    以下内容引用自http://wiki.jikexueyuan.com/project/servlet/internationalization.html: 三个重要术语: 国际化(i18n):这意味着 ...

  5. SaltStack学习系列之Nginx部署

    目录结构 |-- nginx | |-- files #放包文件的 | | |-- admin_22.conf | | |-- fastcgi_params | | |-- jim_fix_param ...

  6. http://www.cnblogs.com/sprinkle/

    http://www.cnblogs.com/sprinkle/ http://www.cnblogs.com/sprinkle/

  7. 安装eclipse中html/jsp/xml editor插件以及改动html页面的字体

    近期在做android项目,用到了jquery mobile 框架以及phonegap,所以就会涉及一些html文件,可是html文件打开的方式是Text Editor ,而且打开之后一些html代码 ...

  8. String类的四个默认成员函数

    优化版的拷贝构造函数,先创建一个暂时实例tmp,接着把tmp._ptr和this->_ptr交换,因为tmp是一个局部变量.程序执行到该函数作用域外,就会自己主动调用析构函数.释放tmp._pt ...

  9. vmstat输出项解释

    输出项的解释例如以下: procs * r列表示执行和等待cpu时间片段的进程数,这个值假设长期大约系统cpu个数.说明cpu不足 * b列表示在等待资源的进程数.比方正在等待IO或者内存交换等等 m ...

  10. Python正則表達式小结(1)

    学习一段python正則表達式了, 对match.search.findall.finditer等函数作一小结  以下以一段网页为例,用python正則表達式作一个范例: strHtml = '''& ...