php-fpm 111: connection refused,nginx和php-fpm配置 错误connect() failed (111: Connection refused) while c...

若fpm配置文件中配置如下:

listen = 127.0.0.1:9000

则对应的nginx.conf中的配置应为:

fastcgi_pass 127.0.0.1:9000;

此时开启9000端口监听,不会生成sock文件

0ddfea82529598a6d8f2c645a8da6d4f.png

若fpm中的配置为使用Unix套接字,如下:

listen = /run/php/php7.2-fpm.sock

则对应nginx.conf中的配置应为:

fastcgi_pass unix:/run/php/php7.2-fpm.sock;

此时9000端口未开启,在/run/php/下生成php7.2-fpm.sock文件:

1c4207502ff2d4d7baa9b1e21101a2d0.png

若两者不匹配则nginx启动失败。

若fpm为sock,nginx为127.0.0.1:9000,则会出现以下错误:

connect() failed (111: Connection refused) while connecting to upstream

若fpm未127.0.0.1:9000,nginx为sock,则会出现以下错误:

connect() to unix:/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream

标签:nginx,fpm,sock,php7.2,failed,while,9000,php

来源: https://www.cnblogs.com/adhzl/p/11808922.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值