分页: 1 / 1

nginx一直报错, 请帮忙看看日志,怎么解决

发表于 : 2011-09-27 14:02
weizhao029
nginx的error日志里经常报错

2011/09/27 13:03:47 [error] 17493#0: *7438996 connect() failed (111: Connection refused) while connecting to upstream, client: 180.168.109.106, server: mysite.com, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "mysite.com"
2011/09/27 13:03:48 [error] 17493#0: *7438996 connect() failed (111: Connection refused) while connecting to upstream, client: 180.168.109.106, server: mysite.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "mysite.com"
2011/09/27 13:03:49 [error] 17493#0: *7438996 connect() failed (111: Connection refused) while connecting to upstream, client: 180.168.109.106, server: mysite.com, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "mysite.com"

php-fpm的 ERROR级别的日志是,

[27-Sep-2011 12:08:02] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
[27-Sep-2011 12:30:04] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
[27-Sep-2011 12:40:04] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
[27-Sep-2011 12:50:04] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
[27-Sep-2011 12:57:04] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
[27-Sep-2011 13:03:04] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
[27-Sep-2011 13:03:04] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)

偶尔出现
[26-Sep-2011 17:48:24] ERROR: ptrace(PEEKDATA) failed: Input/output error (5)
[26-Sep-2011 17:49:04] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
[26-Sep-2011 17:49:32] ERROR: ptrace(PEEKDATA) failed: Input/output error (5)
[26-Sep-2011 17:49:33] ERROR: ptrace(PEEKDATA) failed: Input/output error (5)
[26-Sep-2011 17:49:42] ERROR: ptrace(PEEKDATA) failed: Input/output error (5)

Re: nginx一直报错, 请帮忙看看日志,怎么解决

发表于 : 2011-09-27 20:40
missU
ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)
很明显9000端口被占用。
3个解决办法
1 在nginx.conf中换个php的端口试试
2 实在不行还有sock方式。
3 杀死那个占用9000端口的程序。

选择题,lz去选吧。

Re: nginx一直报错, 请帮忙看看日志,怎么解决

发表于 : 2011-09-30 14:16
weizhao029
sock方式应该怎么做呢?
怎么做到在出现错误的时候自动杀死那个占用9000端口的程序,然后能正常启动

Re: nginx一直报错, 请帮忙看看日志,怎么解决

发表于 : 2011-09-30 19:53
missU
怎么做到在出现错误的时候自动杀死那个占用9000端口的程序,然后能正常启动
人工智能?

俺不会。

Re: nginx一直报错, 请帮忙看看日志,怎么解决

发表于 : 2011-09-30 21:11
weizhao029
那sock方式应该怎么做呢?

Re: nginx一直报错, 请帮忙看看日志,怎么解决

发表于 : 2011-10-24 23:43
wx2236y
。。。配置 php-fpm 文件 将 127.0.0.1:9000 换掉 可以换 端口 也可 换sock 的 绝对 路径

Re: nginx一直报错, 请帮忙看看日志,怎么解决

发表于 : 2012-04-25 21:08
xyy_xx

代码: 全选

sudo vim /etc/php/php-fpm.conf

代码: 全选

listen = 127.0.0.1:9000
listen = /var/run/php-fpm/php-fpm.sock