[原创]配置php+nginx 时遇到的”file not found","access denied"奇怪问题的解决过程
在centos 7中按照我的随笔转载文章"[转载]CentOS 下安装LEMP服务(Nginx、MariaDB/MySQL和PHP)"安装好后,结果无法显示phpinfo()信息,出现过“file not found","No iput file is specifed","access denied"等各种奇怪错误,百度了各种文章都说是/etc/nginx/conf.d/default.conf配置里的路径root配置不正确造成的,但检查了几千遍也没发现有问题。经过查看/var/logs/nginx/error.log日志发现了问题所在:
2015/03/23 20:54:57 [error] 3246#0: *4 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/share/nginx/html/test.php) is not within the allowed path(s): (.:/tmp/) 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: /usr/share/nginx/html/test.php (Permission denied)" while reading response header from upstream, client: 192.168.1.101, server: localhost, request: "GET /test.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.107"
2015/03/23 20:54:57 [error] 3246#0: *4 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/share/nginx/html/test.php) is not within the allowed path(s): (.:/tmp/) in Unknown on line 0
很显然问题在php.ini的open_basedir限制了能够读取的文件夹,只设置了open_basedir=.:/tmp/,而/usr/share/nginx/html/没有在其中,将目录加入一切正常。
[原创]配置php+nginx 时遇到的”file not found","access denied"奇怪问题的解决过程的更多相关文章
- centos7下nginx添加到自定义系统服务中提示Access denied
安装好nginx后,添加到系统服务中 在/usr/lib/systemd/system下创建nginx.service文件内容如下: [Unit] Description=nginx - high p ...
- 1.在配置XML文件时出现reference file contains errors (http://www.springframework.org/schema/beans/...解决方案
解决方案: 第一步:将 Preferences > XML > XML Files > Validation中"Honour all XML schema location ...
- 解决nginx配置负载均衡时invalid host in upstream报错
当前平台: windows nginx版本: 1.11.5 前言: 在配置负载均衡时,同时也需要设置反向代理,当修改了nginx.conf时,发现nginx服务无法开启. 1. 打开"ngi ...
- Centos 7 上使用nginx为Node.js配置反向代理时错误:(13: Permission denied) while connecting to upstream
错误来源:Centos 7 上使用nginx为Node.js配置反向代理时产生(13: Permission denied) while connecting to upstream的错误 nginx ...
- 配置好Nginx后,通过flume收集日志到hdfs(记得生成本地log时,不要生成一个文件,)
生成本地log最好生成多个文件放在一个文件夹里,特别多的时候一个小时一个文件 配置好Nginx后,通过flume收集日志到hdfs 可参考flume的文件 用flume的案例二 执行的注意点 avro ...
- PHP入门及服务环境配置(Nginx+PHP)
PHP入门及服务环境配置(Nginx+PHP) PHP入门 PHP维基百科: PHP(全称:PHP:Hypertext Preprocessor,即"PHP:超文本预处理器")是一 ...
- 配置Linux Kernel时make menuconfig执行流程分析
在编译内核前,一般是根据已有的配置文件(一般在内核根目录下的arch/arm/configs/文件夹下,把该目录下的xxx_defconfig文件拷贝到内核根目录下,并重命名为.config)来 ...
- 配置安装nginx
1.解决依赖关系和优化所需的组件 编译安装nginx需要事先需要安装开发包组"Development Tools" .同时,安装pcre-devel包,用yum安装即可 安装TCM ...
- Nginx 安装与部署配置以及Nginx和uWSGI开机自启
下载 官方网站:https://nginx.org/en/download.html Windows下安装 安装 下载后解压(切记不能含有中文路径!!),文件结构如图(我解压的路径就有中文,记得拷贝放 ...
随机推荐
- 【软件工具】Git 使用总结
本地库就是由 对象 和 引用 构成的,或者叫 Repositories;下面是我整理的常用 Git 命令清单.几个专用名词的译名如下. Workspace:工作区 Index / Stage:暂存区 ...
- mongoose报错:DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead
参考:mongoose报错:DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead mo ...
- asp.net core 知识点总结
- .Net Framwork /.Net Core 发布为NuGet包
一.使用NuGet发布包 下载NuGet命令行工具: https://dist.nuget.org/win-x86-commandline/v5.8.0/nuget.exe 下载NuGet Packa ...
- WPF 中的形状和基本绘图概述
本主题概述如何使用 Shape 对象绘图. Shape 是一种允许您在屏幕中绘制形状的 UIElement 类型. 由于它们是 UI 元素,因此 Shape 对象可以在 Panel 元素和大多数控件中 ...
- QT 自定义控件 以及信号和槽的使用
自定义login 控件 Login头文件 #ifndef LOGIN_H #define LOGIN_H #include <QWidget> namespace Ui { class L ...
- 十三:Servlet3.0的异步
servlet之前的操作同时同步的,就是按照这样的一个流程来走的: 1.请求根据一个路径路由到一个servlet中, 2.servlet获取一系列的参数 3.执行一系列的逻辑(花费时间所占的比重也更大 ...
- 刷题-力扣-337. 打家劫舍 III
337. 打家劫舍 III 题目链接 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/house-robber-iii 著作权归领扣网络所有.商 ...
- Kickstart部署多系统
原文转自:https://www.cnblogs.com/itzgr/p/10029587.html作者:木二 目录 一 准备 1.1 完整架构:Kickstart+DHCP+HTTP+TFTP+PX ...
- golang map实现原理
这篇文章主要讲 map 的赋值.删除.查询.扩容的具体执行过程,仍然是从底层的角度展开.结合源码,看完本文一定会彻底明白 map 底层原理. 我要说明的是,这里对 map 的基本用法涉及比较少,我相信 ...