centos搭建 nginx一直报错 file not found.
百度了半天找到别人的解决办法 记录下
摘要: file not found. nginx php 这个问题是你配置文件的问题: 查看就是了不要管 nginx 如何开启解析 PHP 的功能? # 成功安装后,创建 php-fpm.conf 配置文件,删除 nginx.conf 中“pass the PHP scripts to FastCGI
file not found. nginx php
这个问题是你配置文件的问题:
查看就是了不要管
nginx 如何开启解析 PHP 的功能?
# 成功安装后,创建 php-fpm.conf 配置文件,删除 nginx.conf 中“pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000”部分的注释
cd /usr/local/php/etc
mv php-fpm.conf.default php-fpm.conf
vi /usr/local/nginx/conf/nginx.conf
# 删除如下部分的注释,保存退出,
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
解决办法:
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
这一句有问题,请再仔细查想一下为什么?
- 华晨@kut : 发现了更好的办法,/scripts 改成 $document_root 就好了,呵呵。 (
- 华晨@kut : 哦,我知道了,把 /scripts 改成 /usr/local/nginx/html 就可以了。我刚才在服务器上试了一下,真的可以找到文件并且成功解析了!十分感谢! (4年前)
- kut@华晨: /scripts是一个目录名,也就是你站点的根目录,比如说,你访问/index.php这个文件,其实就是访问操作系统中/scripts/index.php这个文件,这个文件是否存在?(4年前)
重启nginx就可以解析php了。
# 启动 php-fpm 和 nginx
/usr/local/php/sbin/php-fpm
/usr/local/nginx/sbin/nginx
# 在 nginx 的 html 目录下放一个 php 文件,浏览器访问,不能解析,显示“ File not found.”
centos搭建 nginx一直报错 file not found.的更多相关文章
- nginx 启动报错“var/run/nginx/nginx.pid" no such file or directory
nginx 启动报错“var/run/nginx/nginx.pid" no such file or directory 今天刚搭建的nginx服务器启动时,报错“var/run/ngin ...
- centos7 安装nginx和php5.6.25遇到 无法访问php页面 报错file not found 问题解决
php-fpm安装完成,nginx安装完成 netstap -ntl| 发下端口正常开启 iptables -L 返现9000端口已经开放 ps -aux|grep nginx 发下nginx进程正常 ...
- 重启虚拟机后,再次重启nginx会报错:[emerg] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)
问题: 重启虚拟机后,再次重启nginx会报错: open() "/var/run/nginx/nginx.pid" failed (2: No such file or dire ...
- FastDFS整合nginx后,nginx一直报错
FastDFS整合nginx后,nginx一直报错: 报错内容: [2018-06-11 09:41:21] ERROR - file: ../common/fdfs_http_shared.c, l ...
- nginx 启动报错 “/var/run/nginx/nginx.pid" failed” 解决方法
问题: 重启虚拟机后,再次重启nginx会报错: open() "/var/run/nginx/nginx.pid" failed (2: No such file or dire ...
- Nginx 启动报错 “/var/run/nginx/nginx.pid" failed”
问题: 重启虚拟机后,再次重启nginx会报错: open() "/var/run/nginx/nginx.pid" failed (2: No such file or dire ...
- centos在yum install报错:Another app is currently holding the yum lock解决方法
centos在yum install报错:Another app is currently holding the yum lock,这个问题可能是很多的新手经常遇到问题,之前也有人问我,包括本人在刚 ...
- Nginx启动报错:10013: An attempt was made to access a socket in a way forbidden
Nginx在win7,win2008下启动报错:bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket i ...
- nginx默认80端口被System占用,造成nginx启动报错的解决方案
今天启动window上的nginx总是报错 错误信息是bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socke ...
随机推荐
- 78 mount 挂载Linux系统外的文件。
语法 mount [-hV] mount -a [-fFnrsvw] [-t vfstype] mount [-fnrsvw] [-o options [,...]] device | dir mou ...
- iPad开发--QQ空间布局,登录模块
一.登录模块 登录逻辑 - (IBAction)loginClick:(UIButton *)sender { self.view.userInteractionEnabled = NO; [self ...
- nginx正向代理,反向代理,透明代理(总结)
1正向代理 正向代理,也就是传说中的代理,他的工作原理就像一个跳板, 简单的说, 我是一个用户,我访问不了某网站,但是我能访问一个代理服务器 这个代理服务器呢,他能访问那个我不能访问的网站 于是我先连 ...
- .Net Core 1.0.0 RC2安装及示例教程
前几天微软发布了.Net Core1.0.0 RC2 Preview版本,一直都想尝试下跨平台的.Net Core,一直拖到今天,也参考了下园友们的经验,闲时整理了一下安装的步骤,供大家参考. 我们要 ...
- 【ASP.NET Identity系列教程(二)】运用ASP.NET Identity
注:本文是[ASP.NET Identity系列教程]的第二篇.本系列教程详细.完整.深入地介绍了微软的ASP.NET Identity技术,描述了如何运用ASP.NET Identity实现应用程序 ...
- Spring中配置和读取多个Properties文件
一个系统中通常会存在如下一些以Properties形式存在的配置文件 1.数据库配置文件demo-db.properties: database.url=jdbc:mysql://localhost/ ...
- hdu3437 划分树 区间内小于第K大的值得和
Minimum Sum Time Limit: 16000/8000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tot ...
- android开发之生命周期
android开发之生命周期 一:Activity的生命周期: 这几天了了解了安卓Activity的生命周期,对于生命周期有了大概的理解: 一个Activity的生命周期也就是Activity从生成到 ...
- 【BZOJ-4316】小C的独立集 仙人掌DP + 最大独立集
4316: 小C的独立集 Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 57 Solved: 41[Submit][Status][Discuss] ...
- 【BZOJ-3144】切糕 最小割-最大流
3144: [Hnoi2013]切糕 Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 1261 Solved: 700[Submit][Status] ...