按照网上的资料,安装了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;
}
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;
}
应该不是Nginx与php的问题,弄个简单的test.php页面测试一下。
如果有的说明你目录指向有问题,目录指向需要用到绝对路径。
D:/wnmp/nginx1.3 这个要修改成你的nginx的路径