nginx错误连接到php5-fpm.sock失败(13:权限被拒绝)
我将nginx更新为 ,将php 更新为 ,之后得到了 。在更新之前,一切正常。
nginx-error.log
2014/05/03 13:27:41 [crit] 4202#0: *1 connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied) while connecting to upstream, client: xx.xxx.xx.xx, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "xx.xx.xx.xx"nginx.conf
user  www www;worker_processes  1;
        location / {
            root   /usr/home/user/public_html;
            index  index.php index.html index.htm;
        }
        location ~ [^/]\.php(/|$) {
            fastcgi_split_path_info ^(.+?\.php)(/.*)$;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param  SCRIPT_FILENAME    /usr/home/user/public_html$fastcgi_script_name;
            include fastcgi_params;
        }
回答:
php更新后出现类似错误。PHP固定一个安全漏洞,其中o有rw权限的套接字文件。
- 打开
/etc/php5/fpm/pool.d/www.conf或/etc/php/7.0/fpm/pool.d/www.conf,具体取决于您的版本。 取消注释所有权限行,例如:
listen.owner = www-datalisten.group = www-data
listen.mode = 0660
重新启动fpm-
sudo service php5-fpm restart或sudo service php7.0-fpm restart
 :如果您的网络服务器以www-data以外的用户身份运行,则需要相应地更新www.conf文件
以上是 nginx错误连接到php5-fpm.sock失败(13:权限被拒绝) 的全部内容, 来源链接: utcz.com/qa/429154.html
