配置如下:
location ~ .php$
{
include fastcgi_params;
fastcgi_pass unix:/tmp/php-fcgi.sock; #sock所在目录,碰到502。看错误日志。
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /data/wwwroot/test.com$fastcgi_script_name;
}
fastcgi_pass 用来指定php-fpm监听的地址或者socket
看这的路径是什么 ,上面填写什么

或者写成ip地址+端口

这快的路径,也需要和上面的root路径符合 。

改成是666,是为了让任何用户都有读写的权限

Linux-Nginx解析php相关配置
原文:http://blog.51cto.com/13451715/2324060