按照网上的资料,安装了nginx和php,访问html是没问题的,可是访问php就会报错“The page you are looking for is temporarily unavailable.
Please try again later. ”经过看后台的日志“50.255.99.156 - - [17/Nov/2012:16:38:26 +0800] "GET / HTTP/1.1" 502 383 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows N    T 5.1; Trident/4.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)" -我安装的php是5.3.8,php-fpm可以正常运行,用户和用户组都是nobodynginx的版本是1.2.3 ,我的服务端配置是
log_format  accessi  '$remote_addr - $remote_user [$time_local] "$request" '     
            '$status $body_bytes_sent "$http_referer" '     
                                            '"$http_user_agent" $http_x_forwarded_for'; 
server { 
        listen 80;
        server_name hainan-online.com;
        location / { 
                root /usr/local/nginx/html;
                index default.php index.php index.html index.htm; 
        } 
        error_page 404 /error.html; 
        error_page 500 502 503 504 /50x.html; 
        location = /50x.html { 
                root html; 
        } 
        location ~ \.php$ { 
                fastcgi_pass  unix:/tmp/php-cgi.sock;
                root /usr/local/nginx/html;
                fastcgi_index index.php                                                         SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;
                include fastcgi_params;
        }         location ~ /\.ht { 
                deny all; 
        } 
        access_log  /usr/local/nginx/logs/hainan.log accessi;

解决方案 »

  1.   

    php-fpm的配置呢?
    应该不是Nginx与php的问题,弄个简单的test.php页面测试一下。
      

  2.   

    502一般是nginx访问不到php-fpm。建议先不使用sock文件,而使用端口来配置
      

  3.   

    楼主如果运行在window上,看看进程里面是否有nginx和fastcgi进程。
    如果有的说明你目录指向有问题,目录指向需要用到绝对路径。
      

  4.   

    linux系统上目录权限问题。
      

  5.   

    测试一下你的nginx配置文件是否正确D:/wnmp/nginx1.3/nginx.exe -t -p D:/wnmp/nginx1.3
    D:/wnmp/nginx1.3 这个要修改成你的nginx的路径
      

  6.   

    不应该是nobody 应该是当前用户名 比如PHP以jerry身份启动就要是jerry    试试去吧 肯定可以的! yeah!!