9月 152014
 

最近将Nginx从1.60升级到1.61,然后发现php不能解析了。
切换回Apache,工作正常,说明不是php5-fpm的问题,而确实是nginx出问题了。

生产环境,若要稳定,还是apache比较好,很多年了从来没有出现类似的问题。
但是nginx的性能是有目共睹的。

回到正题,google了一下,解决办法如下:
In 1.6.0 you’d do something like this to use fastcgi / php5-fpm:
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}

However after upgrading to 1.6.1, you need to update the include line to this:
#include fastcgi_params;
include fastcgi.conf;

已经有人在报bug:
1.6.1/1.7.4 and newer breaks FastCGI
https://bugs.launchpad.net/nginx/+bug/1366651

 回复

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>