php fast cgi nginx,fast-cgi启动了,但是nginx无法执行php

我用的是ubuntu12.04,php是5.2.10然后用的spawn-fcgi。top里面能看到php5-cgi启动起来了,访问html没问题,我用nginx upstream转发到apache(8080端口)也能执行php程序,就是fastcgi有问题。网页提示502,日志 connect() failed (111: Connection refused)

我用的是ubuntu12.04,php是5.2.10然后用的spawn-fcgi。top里面能看到php5-cgi启动起来了,访问html没问题,我用nginx upstream转发到apache(8080端口)也能执行php程序,就是fastcgi有问题。网页提示502,日志

connect() failed (111: Connection refused) while connecting to upstream, client: 123.151.148.160, server: new.cdfdc.gov.cn, request: "GET /archive.php?addno=8&aid=120&ccid12=3032&ccid5=184&ccid6=188&fang=zhu&sort=mj:1 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "new.cdfdc.gov.cn", referrer: "http://new.cdfdc.gov.cn/"

服务器内存什么的消耗都很低,基本上不会是资源不足问题。另外fastcgi进程使用数也远远没有达到我的设定的进程数目

我的网站配置

server {

listen 80;

server_name fdcsck.com www.fdcsck.com;

# handling 404 error for root

error_page 404 /index.html;

access_log /var/log/nginx/access.log;

error_log /var/log/nginx/sck_error.log;

location / {

root /var/www/fdcsck;

index index.php index.html index.htm;

}

location ~ \.php$ {

include fastcgi_params;

fastcgi_pass 127.0.0.1:9000;

#fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME /var/www/fdcsck$fastcgi_script_name;

}

nginx 配置

user www-data;

worker_processes 2;

pid /var/run/nginx.pid;

events {

worker_connections 768;

# multi_accept on;

}

##

# Basic Settings

##

sendfile on;

tcp_nopush on;

tcp_nodelay on;

keepalive_timeout 65;

types_hash_max_size 2048;

client_max_body_size 100m;

# server_tokens off;

# server_names_hash_bucket_size 64;

# server_name_in_redirect off;

include /etc/nginx/mime.types;

default_type application/octet-stream;

求各位大神指点。小弟感激不尽

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值