admin 管理员组

文章数量: 887021

nginx 访问php 502,php

php-fpm是正常启动的,如下

liweideiMac:~ liwei$ ps -ef | grep php-fpm

501  2756     1   0 12:38下午 ??         0:00.00 /usr/local/Cellar/php55/5.5.14/sbin/php-fpm

501  2757  2756   0 12:38下午 ??         0:00.00 /usr/local/Cellar/php55/5.5.14/sbin/php-fpm

501  2758  2756   0 12:38下午 ??         0:00.00 /usr/local/Cellar/php55/5.5.14/sbin/php-fpm

501  2759  2756   0 12:38下午 ??         0:00.00 /usr/local/Cellar/php55/5.5.14/sbin/php-fpm

501  2761  1217   0 12:38下午 ttys000    0:00.00 grep php-fpm

nginx也是正常启动的

$ ps -ef | grep nginx

0   231   158   0 10:19上午 ??         0:00.02 nginx: master process /usr/local/opt/nginx/bin/nginx -g daemon off;

70  1858   231   0 11:39上午 ??         0:00.01 nginx: worker process

70  1859   231   0 11:39上午 ??         0:00.54 nginx: worker process

70  1860   231   0 11:39上午 ??         0:00.53 nginx: worker process

70  1861   231   0 11:39上午 ??         0:00.54 nginx: worker process

70  1862   231   0 11:39上午 ??         0:00.05 nginx: cache manager process

501  2772  1217   0 12:40下午 ttys000    0:00.00 grep nginx

访问PHP的时候提示

An error occurred.

Sorry, the page you are looking for is currently unavailable. Please

try again later.

If you are the system administrator of this resource then you should

check the error log for details.

Faithfully yours, nginx.

打开日志看到如下:

127.0.0.1 - - [30/Jun/2014:12:38:19 +0800] "GET /info.php HTTP/1.1" 502 537 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36"

请问如何解决?

搞清楚问题了,其实都没问题,只是nginx我开启了缓存,我第一次启动失败后,他缓存了502

下次我再访问他就一直都是502了

我将地址后面加了一个?a=1,发现一切正常

本文标签: nginx 访问php 502 php