在centos上成功编译安装nginx 1.4、php 5.4并成功启动nginx和php-fpm后,访问php提示"File not found.",同时在错误日志中看到:

复制代码 代码如下:
2013/10/22 20:05:49 [error] 12691#0: *6 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.168.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.168.133" 错误解决方法:
在Nginx配置文件中找到定义调用脚本文件的地方,如: 复制代码 代码如下:
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 修改成如下方式($document_root): 复制代码 代码如下:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 提示:
$document_root 代表当前请求在root指令中指定的值。如: 复制代码 代码如下:
location / {
root /usr/local/nginx/html;
index index.php index.html index.htm;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
} 上面配置中的$document_root就是针对/usr/local/nginx/html目录下的php文件进行解析。

nginx FastCGI错误Primary script unknown解决办法的更多相关文章

  1. Nginx 502错误触发条件与解决办法汇总(转载)

    一些运行在Nginx上的网站有时候会出现“502 Bad Gateway”错误,有些时候甚至频繁的出现.有些站长是在刚刚转移到Nginx之后就出现了这个问题,所以经常会怀疑这是不是Nginx的问题,但 ...

  2. 解决nginx FastCGI sent in stderr: “Primary script unknown”

    今天重启了mac,突然发现本地的 lnmp 服务不能用了,什么请求都返回了: FastCGI sent in stderr: "Primary script unknown" 这个 ...

  3. Nginx+PHP配置错误,日志:[error] 24324#0: *31 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream

    一.问题现象 1.安装nginx.php.php-fpm后,浏览器访问php报错,“File not found”: 二.问题排查 1.检查nginx.php-fpm服务是否正常启动,均正常启动: 2 ...

  4. 【nginx】 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream

    2013/10/22 20:05:49 [error] 12691#0: *6 FastCGI sent in stderr: "Primary script unknown" w ...

  5. Nginx-Primary script unknown的报错的解决方法

    配置nginx时一直报错:file not found 错误日志: [error] 12691#0: *6 FastCGI sent in stderr: "Primary script u ...

  6. nginx+php-fpm 报错Primary script unknown

    报错信息(nginx日志): // :: [crit] #: * stat() : Permission denied), client: 172.21.205.25, server: localho ...

  7. FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream,

    在对nginx添加fastCGI的支持后,然后进行php页面验证,发现页面识别不到,不清楚什么情况,随后google了下,原来是Nginx内置变量问题惹的祸. 1.平台介绍: 1 2 3 4 5 6 ...

  8. [error] 1507#0: *22 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 10.0.0.1, server: www.wordpress.com, request: "GET /info.p

    字体比较小,如果你遇到这个问题请仔细的把下面的总结看完. 环境:CentOS6.7.2.6.32-573.el6.x86_64.nginx1.12.2 .php5.5.38 问题:nginx能解析静态 ...

  9. [PHP] 安装PHP报错“Primary script unknown”的解决方法

    当安装完最新版的nginx和最新版的PHP以后,使用niginx默认配置文件中的PHP配置会有错误访问指定目录下的php文件时,显示File not found.错误.查看nginx的错误日志显示 9 ...

随机推荐

  1. 5 jmeter性能测试小小的实战

    项目描述 被测网址:www.sogou.com指标:相应时间以及错误率场景:线程数 20.Ramp-Up Period(in seconds) 10.循环次数 10 测试步骤 1.打开jmeter工具 ...

  2. AlertWindowManager 弹出提示窗口使用帮助(上)

    LookAndFeel(界面外观): NativeStyle:本地化界面为真实用系统内置外观 SkinName:本地化界面(NativeStyle:)设置为假可使用皮肤外观 OptionAnimate ...

  3. 这些linux技巧大大提高你的工作效率

    前言 linux中的一些小技巧可以大大提高你的工作效率,本文就细数那些提高效率或者简单却有效的linux技巧. 命令编辑及光标移动 这里有很多快捷键可以帮我们修正自己的命令.接下来使用光标二字代替光标 ...

  4. localhost/get/user.json localhost/get/user.xml

    我也是引入了jackson-dataformat-xml这个依赖,它是提供了jackson将实体类转化为xml相关的作用.而本身jackson是可以将实体类转化为json的,所以这样Jackson是可 ...

  5. 华为核心交换机绑定IP+MAC+端口案例

    1         案例背景 某网络改造项目,核心交换机为华为S5700,接入交换机为不同型号交换机,如下模拟拓扑,客户端接入交换机1通过Access模式与核心交换机连接,该交换机下只有一个Vlan2 ...

  6. node—基础命令

    1.安装node,在任意文件夹下按shift键选中“在此处打开PowerShell窗口”或者直接在开始菜单输入cmd启动 2.常用命令: c: 如果我们想访问c盘,那么我们需要在命令行中输入c:就行了 ...

  7. (转)Mysql LIMIT如何正确对其进行优化

    以下的文章主要是对Mysql LIMIT简单介绍,我们大家都知道LIMIT子句一般是用来限制SELECT语句返回的实际行数.LIMIT取1个或是2个数字参数,如果给定的是2个参数,第一个指定要返回的第 ...

  8. Google之路

    1,找一个靠谱的dns 2, 替换 C:\Windows\System32\drivers\etc\hosts文件 3,刷新dns 在cmd下运行 ipconfig /flushdns 成功后会提示: ...

  9. [LeetCode] 620. Not Boring Movies_Easy tag: SQL

    X city opened a new cinema, many people would like to go to this cinema. The cinema also gives out a ...

  10. selenium及webdriver的原理【转】

    selenium与webdriver整合后,形成的新的测试工具叫做selenium2.x.在selenium1时间,selenium使用javascript来达到测试自动化的目标. 1. seleni ...