FastCGI sent in stderr: Primary script unknown 解决办法

将 root /data/html ;
放入server中

server{
    listen 80;
    server_name test001.com  www.test001.com;
    root /data/html;
    access_log /logs/nginx/access_test001.log main;
    error_log /logs/nginx/error_test001.log ;
    location /{
    #       root /data/html;
            index index.php index.html index.htm;
    }

    error_page 500 502 503 504 /50x.html;

    location = /50x.html{
            root /data/html;
    }

    location ~ \.php$ {
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
    }
   location ~ .*\.(bmp|gif|jpg|jpeg|png|swf)$ {
        access_log off;
        expires 30d;
    }
}
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
FastCGI sent in stderr: "primary script unknown" 是一种错误信息,它通常发生在使用PHP时。它的意思是FastCGI无法找到要执行的主要脚本。在Web服务器和PHP之间的通信中,FastCGI是一个桥梁。当您请求一个PHP脚本时,Web服务器将请求发送到FastCGI进程,然后再由FastCGI进程执行该脚本并将结果返回给Web服务器。 当出现"primary script unknown"错误时,它通常是由以下原因之一引起的: 1.文件或目录权限不正确 当FastCGI无法访问脚本或目录时,它将返回"primary script unknown"错误。这可能是因为文件或目录权限不正确导致的。确保您的PHP文件和目录具有足够的权限,以便FastCGI可以访问它们。 2.PHP文件缺失或无法使用 如果您的PHP文件丢失或损坏,FastCGI也将无法找到它并返回"primary script unknown"错误。请确保您的PHP文件存在于正确的位置,并且它们是有效的。 3.错误的FastCGI参数 如果您的FastCGI参数不正确,例如指向错误的脚本路径或FastCGI端口,也会导致FastCGI返回"primary script unknown"错误。确保您使用正确的FastCGI参数。 解决这个问题,您可以首先检查文件和目录权限是否正确,确保PHP文件存在,并且检查您的FastCGI参数是否正确。如果问题仍然存在,请尝试重新安装FastCGIPHP,并确保它们都是最新的版本。同时,查看PHPFastCGI的错误日志以获取更多详细信息。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值