安装 lnmp 后 发现怎么都运行不了 laravel 一直显示500 状态码,都给了 stoage 目录权限了 。于是开启 php 错误。

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

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

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

错误日志显示,访问脚本不在 open_basedir的限定目录里面,配置open_basedir 一般会在php.ini 或 nginx 配置文件里面

首先检测php.ini 我发现并没有配置 open_basedir

然后检测nginx配置,去到 nginx 根目录,运行

grep -rn open_basedir ./
复制代码

发现 fastcgi.conf 中配置了open_basedir $document_root指向的是网站跟目录。 我改成了下面内容

#fastcgi_param   PHP_ADMIN_VALUE  "open_basedir=$document_root/:/tmp/:/proc/";
复制代码

重启 nginx 服务

service nginx reload
复制代码

转载于:https://juejin.im/post/5a333e6a51882520ea3a3956

LNMP环境运行laravel open_basedir restriction in effect 问题相关推荐

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

    LNMP - Warning: require(): open_basedir restriction in effect错误解决方法 参考文章: (1)LNMP - Warning: require ...

  2. 【lnmp】require(): open_basedir restriction in effect.【百度不是万能的,关键时刻还得靠自己】

    TP5的项目,多模块设置多多个站点入口: 推上线时一堆问题,之一:权限问题 由于所有模块公用 thinkphp框架文件,在调用时报错 require(): open_basedir restricti ...

  3. laravel 线上报错Warning: require(): open_basedir restriction in effect. File(/www/wwwroot/ytsjk/bootstra

    laravel 线上 Warning: require(): open_basedir restriction in effect. File(/home/wwwroot/default/larave ...

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

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

  5. THINKPHP搭建报错Warning: require(): open_basedir restriction in effect.File() is not within the allowed

    注意:当前只适用于LNMP环境 会提示 Warning: require(): open_basedir restriction in effect. File(/www/wwwroot/wxsmal ...

  6. php warning require,Thinkphp 网站打开提示Warning: require(): open_basedir restriction in effect另一种解决方法...

    Thinkphp网站打开报错如下: Warning: require(): open_basedir restriction in effect. File(/www/wwwroot/123.com/ ...

  7. 宝塔部署项目报Warning: require(): open_basedir restriction in effect的解决方案

    宝塔部署项目报Warning: require(): open_basedir restriction in effect的解决方案 参考文章: (1)宝塔部署项目报Warning: require( ...

  8. lnmp环境配置laravel项目白屏问题

    开启日志显示: Warning: require(): open_basedir restriction in effect. File(/xxxx/bootstrap/autoload.php) i ...

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

    open_basedir restriction in effect,解决php引入文件权限问题 参考文章: (1)open_basedir restriction in effect,解决php引入 ...

最新文章

  1. Heritrix源码分析(六) Heritrix的文件结构分析
  2. Java基础学习总结(52)——Liunx系统Centos上搭建Java开发环境
  3. SqlServerDBCC SHRINKFILE不起作用
  4. oracle10递归 nocycle,oracle 使用递归的性能提示测试对比
  5. 使用@Rule在JUnit中测试文件和目录
  6. Win10 取消桌面快捷键图标
  7. 《WF编程》系列之15 - 顺序工作流与SequenceActivity 3 顺序工作流
  8. matlab GUIz之guide
  9. 正弦波叠加成及波的分解
  10. bin文件合并工具(UBIN)使用方法
  11. 交换机和路由器技术-11-VLAN Trunk
  12. 杂谈(1)--人生必知的78种经典效应
  13. 基本数学逻辑学符号(数学知识用程序表达轻松学系列)
  14. 粒子群算法总结+背包问题
  15. 如何把视频嵌入PPT合为一个文件
  16. iOS/iPhone 微信打开doc xls文件报错OfficeImportErrorDomain错误912 打不开文档
  17. 无线路由器(WIFI)经常掉线断网的可能的原因
  18. 改善到底多大? FXAA画质游戏实测
  19. Ubuntu kylin 14.04下的spark1.0.1安装
  20. Mathorcup数学建模竞赛第六届-【妈妈杯】A题:淡水养殖池塘水华发生及池水自净化研究(附一等奖获奖论文、matlab和SAS代码)

热门文章

  1. 全球及中国电池行业需求前景与十四五投资规划分析报告2022-2028年版
  2. 中科微研课题上犹授牌-农业大健康·李喜贵:谋定功能性农业
  3. 硒品牌谋定功能性农业-农业大健康·万祥军:践行健康中国
  4. java中过滤器、监听器、拦截器的区别
  5. [cocoapods]安装cocoapods
  6. 详解在Visual Studio中使用git版本系统
  7. 阿里副总裁肖利华:数智化转型的7个关键词
  8. 手把手演示:如何规划一个企业级数据中台
  9. 后台产品经理入门指南(下)
  10. 深度探讨验证码发展史,账户中心安全科普文