您的位置: 主页 > 必赢国际 > 必赢国际正文

PHP教养程之-nginx露示502处理方法

2019-11-09 00:46  来源:原创  作者:admin  阅读:

      在佰度上查找错误信息:nginx+PHP 错误502 bad gateway时,也没拥有拥有找到好的方法,

      此雕刻时我剖析我的nginx日记文件,我的nginx日记文件寄存放在/usr/local/nginx/logs/nginx_error.log,发皓拥有如次壹行的错误:

      2016/02/22 15:12:26 [crit] 2967#0: *9 connect() to unix:/tmp/php-fcgi.sock failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /2.php HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fcgi.sock:", host: "localhost"

      特佩是:connect() to unix:/tmp/php-fcgi.sock failed (13: Permission denied) while connecting to upstream出产错,

      然后我反节我的nginx的sock文件的权限:

      # ll /tmp

      total 4

      srwxrwxrwx 1 MySQL mysql 0 Feb 22 00:58 mysql.sock

      drwxr-xr-x 3 root root 4096 Feb 16 13:59 pear

      srw-rw---- 1 root root 0 Feb 22 00:58 php-fcgi.sock

      修改后的权限

      [root@centos3 nginx]# chmod 777 /tmp/php-fcgi.sock

      [root@centos3 nginx]# ll /tmp

      total 4

      srwxrwxrwx 1 mysql mysql 0 Feb 22 00:58 mysql.sock

      drwxr-xr-x 3 root root 4096 Feb 16 13:59 pear

      srwxrwxrwx 1 root root 0 Feb 22 00:58 php-fcgi.sock

      露示的结实:

      # curl localhost/2.php

      This is a test

      [root@centos3 nginx]#

      此雕刻时nginx的502错误已处理了;

      更多PHP相干技术请搜索仟锋PHP,做真实的己己己,用良知做教养育。

      互联网+时代,时辰要僵持念书,携顺手仟锋PHP,Dream It Possible。

  • 关键字: