問題描述:
創新互聯公司主營洋縣網站建設的網絡公司,主營網站建設方案,app軟件開發公司,洋縣h5微信小程序定制開發搭建,洋縣網站營銷推廣歡迎洋縣等地區企業咨詢
服務器重啟之后,服務器也正常運行,發現網站訪問不了,后來查看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", upstream: "fastcgi://127.0.0.1:9000", host: "****.leyue.com.cn:22080"
后來google,發現類似不少的問題,就整理了一下,基本上有以下三個原因造成這個問題的原因:
>>>php-fpm沒有安裝 >>>php-fpm沒有運行 可以用ps aux | grep 'php-fpm',來查看. [root@dev ~]# ps aux | grep 'php-fpm' root 4570 0.0 0.1 612024 7820 ? Ss May12 0:04 php-fpm: master process (/etc/php-fpm.conf) fpmport 4571 0.0 0.0 611620 5864 ? S May12 0:00 php-fpm: pool port fpmport 4572 0.0 0.0 611620 5892 ? S May12 0:00 php-fpm: pool port ...... 如果沒有運行,使用啟動: /etc/init.d/php-fpm start >>>php-fpm隊列滿了 php-fpm.conf (/etc/php-fpm.conf)配置文件pm.max_children修改大一點,重啟php-fpm并觀察日志情況 cd
也看到一個,端口被占用的情況:
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)
原因:
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端口的程序。
2>
新聞標題:問題:connect()failed(111:Connectionrefused)whileconnectingtoupstream
標題鏈接:http://vcdvsql.cn/article48/peppep.html
成都網站建設公司_創新互聯,為您提供靜態網站、外貿網站建設、ChatGPT、企業建站、小程序開發、網頁設計公司
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯