nginx和php-fpm配置 错误connect() failed (111: Connection refused) while connecting to upstream connect() to unix:/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream

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

listen = 127.0.0.1:9000

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

fastcgi_pass   127.0.0.1:9000;

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

若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文件:

若两者不匹配则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

原文地址:https://www.cnblogs.com/adhzl/p/11808922.html

时间: 2024-08-12 15:28:17

nginx和php-fpm配置 错误connect() failed (111: Connection refused) while connecting to upstream connect() to unix:/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream的相关文章

nginx connect() failed (111: Connection refused) while connecting to upstream,请求无响应错误

2015/01/02 16:01:36 [error] 29002#0: *714153 connect() failed (111: Connection refused) while connecting to upstream, client: 172.16.3.32, server: bizorder.qianbao666.com, request: "POST /api/queryOrder/orderList HTTP/1.1", upstream: "http:

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

配置好lamp后,在浏览器中运行程序后,出现上面的错误. 转自:http://www.xuejiehome.com/blread-1828.html I'm experiencing 502 gateway errors when accessing a PHP file in a directory (http://domain.com/dev/index.php), the logs simply says this: 2011/09/30 23:47:54 [error] 31160#0:

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

问题描述: 服务器重启之后,服务器也正常运行,发现网站访问不了,后来查看nginx 错误日志(/var/log/nginx/error.log ) 2016/05/13 10:47:32 [error] 7688#0: *8 connect() failed (111: Connection refused) while connecting to upstream, client: ****.****.****.33, server: , request: "GET url HTTP/1.1&

connect() failed (111: Connection refused) while connecting to upstream报错处理

新lnmp环境调试项目时,nginx报错如下: 解决: 发现php-fpm.conf是以套接字方式通信,而nginx是以端口方式通信,见下图: 将nginx.conf修改为如下,重新reload即可 原文地址:https://www.cnblogs.com/godfather007/p/10596265.html

【nginx】kevent() reported that connect() failed (61: Connection refused)

访问php页面时,nginx报如下错误 2014/12/25 12:36:13 [error] 3846#0: *3 kevent() reported that connect() failed (61: Connection refused) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /index.php HTTP/1.1", upstream: "f

Android客户端连接tomcat时出错:connect failed: ECONNREFUSED (Connection refused)

public static final String BASE_URL = "http://127.0.0.1:8090/HelloWord/"...; 会抛异常Caused by: libcore.io.ErrnoException: connect failed: ECONNREFUSED (Connection refused) 解决方法: String url = "http://127.0.0.1:8090/HelloWord/"...;  修改成 pub

“psql: could not connect to server: Connection refused” Error when connecting to remote database

问题: I am trying to connect to a postgres database installed in a remote server using the following command: psql -h host_ip -U db_username -d db_name This the error that occurs: psql: could not connect to server: Connection refused Is the server runn

如何解决远程连接mysql出现Can’t connect to MySQL server on (111 “Connection refused”)的问题

如何解决远程连接mysql出现Can't connect to MySQL server on (111 "Connection refused")的问题 开放Mysql的远程连接 在服务器上登录mysql,然后执行以下的命令. 登录mysql: /usr/local/mysql-5.6/bin/mysql -u root -p 执行赋权的命令: MySQL> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '1234

mariadb报:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "Connection refused")

我这边移除了mysql.sock文件后,重启服务就成功了. 还有一种情况,就是加入galera后,可能是server.cnf配置信息出了问题导致的,修改后,重新运行galera即可,数据库就可以启动成功了. mariadb报:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "Connection refused") 原文地址:h