yum安装的Nginx和编译安装的PHP出现502

心血来潮想试试在各种安装方式下的服务之间的耦合度。

PHP的配置内容:

[test]
listen = /tmp/php_test.sock
listen.mode = 666
user = php-fpm
group = php-fpm
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500
rlimit_files = 1024

Nginx的配置内容:

……省略一些代码……

    location ~ \.php$
    {
        include            fastcgi_params;
        fastcgi_pass       unix:/tmp/php_test.sock;
        fastcgi_index      index.php;
        fastcgi_param      SCRIPT_FILENAME      /data/www/blog$fastcgi_script_name;
    }

……省略一些代码……

看似没毛病的配置,没想到打开浏览器却出现了502错误。

然后将sock换成tcp后:

# PHP中修改为
listen = 127.0.0.1:9000

# Nginx中修改为
        fastcgi_pass       127.0.0.1:9000;

成功访问。

具体原因未明,还要继续研究。

标签: web, 排障

添加新评论