报错:
[error] 12321#0: *92386 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: open_basedir restriction in effect. File(XXX) is not within the allowed path(s): (XXX:/tmp/:/proc/) in Unknown on line 0
PHP message: PHP Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0
Unable to open primary script: XXX/index.php (Operation not permitted)" while reading response header from upstream, client: 221.232.69.252, server: XXX, request: "GET /api/zdfenbu HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi.sock:", host: "XXX"

解决:
有两种方法,需要跟自己的实际情况来选择使用哪一种
1.vim fastcgi.conf
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";一行注释,再执行nginx -s reload即可。
2.vim fastcgi.conf
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";一行改为fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/../:/tmp/:/proc/";再执行nginx -s reload即可。

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报错解决的更多相关文章

  1. 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. ...

  2. 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 ...

  3. Warning: require(): open_basedir restriction in effect. File(/www/wwwroot/../thinkphp/start.php) is not within the allowed path(s):

    Warning: require(): open_basedir restriction in effect. File(/www/wwwroot//../thinkphp/start.php) is ...

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

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

  5. sysctl -P 报错解决办法 error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key

    error: "net.bridge.bridge-nf-call-ip6tables" is an unknown keyerror: "net.bridge.brid ...

  6. Archive required for library “xxx” cannot be read or is not a valid zip file报错解决

    在项目中导入别人的maven项目时报错:Archive required for library “xxx” cannot be read or is not a valid zip file 网上查 ...

  7. 报错解决——linux下执行sh出现异常"syntax error: unexpected end of file"

    有时我们在linux下执行一个sh文件,会报错“SYNTAX ERROR:UNEXPECTED END OF FILE”,这个现象主要是工作的系统环境改变造成的. 若最初脚本中是在windows下,使 ...

  8. Windows下nginx报错解决:CreateFile() "xxx/logs/nginx.pid" failed

    写在前面 本文给出Windows下nginx报错:CreateFile() "xxx/logs/nginx.pid" failed 的解决方法并分析了出错原因,其中 xxx 表示n ...

  9. nfs客户端报错解决Stale file handle

    NFS故障: 场景:客户端挂载是好的.服务端磁盘满了,重新给挂了一快.客户端df -h nfs挂载消失. 客户端报错:Stale file handle 现象如下: [root@test63-spri ...

随机推荐

  1. java中常见的json解析方法、库以及性能对比

    常见的json解析有原生的JSONObject和JSONArray方法,谷歌的GSON库,阿里的fastjson,还有jackson,json-lib. Gson(项目地址:https://githu ...

  2. 主流消息队列rocketMq,rabbitMq比对使用

    首先整理这个文章是因为我正好有机会实战了一下rocketmq,阿里巴巴的一个开源消息中间件.所以就与以往中rabbitmq进行小小的比较一下.这里主线的根据常见面试问题进行整理. 一.消息队列常用的场 ...

  3. Python笔记_第二篇_面向过程_第二部分_2.路径、栈和队列、内存修改

    这一部分分三个主题进行讲解,主要为后面的模块.包.第三方库的概念补充一些相关的内容. 1. 路径(Path): 相对路径和绝对路径. 举例1:我们先导入一个os库(模块)来观察一下路径 import ...

  4. Mac电脑没声音了怎么办?苹果电脑没声音的解决方法

    在使用Mac电脑的过程中,偶尔会出现电脑没声音?发出奇怪的声音?连接外部音频设备出问题等音频故障,遇到这种情况该怎么办呢?小编有妙招! 检查音量 首先检查Mac是否被静音,按住F12快捷键或滑动菜单栏 ...

  5. 功能区按钮调用Excel、PowerPoint、Word中的VBA宏:RunMacro

    功能区按钮调用Excel.PowerPoint.Word中的VBA宏:RunMacro 众所周知,Excel.PPT.Word文档或加载宏文件中可以写很多过程和函数,调试的过程中当然可以按F8或F5直 ...

  6. git commit撤回操作

    git commit 之后没有push,怎么回撤commit操作呢? $ git reset HEAD~

  7. 第一章:基于面向对象的UML

    1.1什么是面向对象 面向对象程序设计(Object-Oriented Programming,OOP)立足于创建软件代码的重复使用,具有更好地模拟现实世界的能力,这使它被公认为是自上而下编程的最佳选 ...

  8. Matlab高级教程_第二篇:Matlab相见恨晚的模块_02_全局变量的妙用_遍历穿透

    1 比如我这边写了一个函数,这个函数中有一个变量作为参数,给定这个参数一个值,然后这个函数返回给我一个值.但是,我写这函数的时候,这个传参我不写到函数里面.可以通过全局变量的方式进行在外部穿透遍历. ...

  9. HDU-3974 Assign the task(多叉树DFS时间戳建线段树)

    http://acm.hdu.edu.cn/showproblem.php?pid=3974 Time Limit: 15000/5000 MS (Java/Others)    Memory Lim ...

  10. 邪恶的csrf

    关于csrf是啥我就不多说了 进入正文 场景模拟 场景一 在一个bbs社区里,用户在发言的时候会发出一个这样的GET请求: #!html GET /talk.php?msg=hello HTTP/1. ...