502带PHP7和Nginx 1.9.9的坏网关

502带PHP7和Nginx 1.9.9的坏网关,php,nginx,Php,Nginx,当我试图访问任何.php文件时,我在Ubuntu14.04上安装了502坏网关和PHP7和nginx 1.9.9错误.html文件按预期加载 我已将default.conf更新为: server { listen 80 default_server; root /usr/share/nginx/html; index index.html index.htm index.php; server_name localhost; location / {

当我试图访问任何
.php
文件时,我在Ubuntu
14.04
上安装了
502坏网关
PHP7
nginx 1.9.9
错误
.html
文件按预期加载

我已将
default.conf
更新为:

server {
    listen 80 default_server;

    root /usr/share/nginx/html;
    index index.html index.htm index.php;

    server_name localhost;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
       fastcgi_split_path_info ^(.+\.php)(/.+)$;
       fastcgi_pass unix:/run/php/php7.0-fpm.sock;
       fastcgi_index index.php;
       include fastcgi_params;
    }
}
我已经用
cgi.fix\u pathinfo=0
更新了
php.ini
,然后重新启动了服务器,但仍然收到所有
.php
文件的
502
错误。我已检查以确保安装了
php7.0-fpm.sock
,且安装位置正确

这是我从nginx日志中得到的错误
2016/01/19 19:14:54[错误]1466#1466:*1 open()“/usr/share/nginx/html/xmlrpc.php”失败(2:没有这样的文件或目录),客户端:85.159.237.13,服务器:localhost,请求:“POST/xmlrpc.php HTTP/1.0”,主机:“my.ip.address”


我寻找答案已经有一段时间了,我已经没有主意了。有人有什么建议吗?

这主要是因为您的nginx和php7.0-fpm不是在同一个用户下运行的。编辑nginx.conf并将“用户nginx”更改为“用户www数据”
顺便说一句,“client:85.159.237.13”,我想那是个脚本男孩。

检查了错误日志和所有?这是不是在
/nginx/site enabled
中?对于日志文件…nginx和php都很有用
/nginx/site enabled
在1.9.9中不是默认设置的,所以我在
etc/nginx/conf.d/default.conf
中检查了
default.conf
,它有一行
include/etc/nginx/conf.d/*.conf我会检查一下日志,然后发布他们所说的内容。我想我有一个问题,结果证明,nginx预期的路径不是我检查php配置时使用的别名路径。您可以检查/etc/中的php目录,并确认在那里听到的是什么套接字(如果您还没有听到的话)。如果内存可用,在我的例子中,我在我的nginx配置中引用了一个版本,就像您一样,但是我在/etc/php-fpm.d/www.conf中的fpm设置有一些不同之处。当我进行这些匹配时,事情开始解决
default.conf
www.conf
/run/php/php7.0-fpm.sock引用相同路径的问题