大家好,小弟是新手,請多包涵
以下是幾個最近在架站遇到的問題所記錄的error log from Nginx
想請問各代表什麼意思,會有什麼影響,該如何除錯。 謝謝,麻煩了
2017/08/01 19:10:50 [error] 22396#22396: *549324 upstream timed out
(110: Connection timed out) while reading response header from upstream,
client: 192.168.0.16, server: _, request: "POST /phpMyAdmin/import.php HTTP/1.1",
upstream: "fastcgi://unix:/run/php-fpm/php56-fpm.sock", host: "192.168.0.200"
2017/08/01 19:15:59 [error] 22396#22396: *549324 upstream timed out
(110: Connection timed out) while reading response header from upstream,
client: 192.168.0.16, server: _, request: "GET /phpMyAdmin/db_import.php?db=drupal&token=2c4c8ee7eba348b4a41f0a09514e61e5
HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/php56-fpm.sock", host: "192.168.0.200"
2017/08/01 19:19:24 [error] 22396#22396: *549741 recv() failed
(104: Connection reset by peer) while reading response header from upstream,
client: 192.168.0.16, server: _, request: "GET /phpMyAdmin/ HTTP/1.1", upstream:
"fastcgi://unix:/run/php-fpm/php56-fpm.sock:", host: "192.168.0.200"
2017/08/01 21:25:00 [error] 18789#18789: *554403 upstream timed out
(110: Connection timed out) while reading response header from upstream,
client: 192.168.0.16, server: _, request: "POST /phpMyAdmin/import.php HTTP/1.1",
upstream: "fastcgi://unix:/run/php-fpm/php56-fpm.sock", host: "192.168.0.200"
2017/08/01 21:30:01 [error] 18789#18789: *554683 recv() failed
(104: Connection reset by peer) while reading response header from upstream,
client: 192.168.0.16, server: _, request: "GET /phpMyAdmin/ HTTP/1.1", upstream:
"fastcgi://unix:/run/php-fpm/php56-fpm.sock:", host: "192.168.0.200"
client: 192.168.0.16, server: _, request: "GET /phpMyAdmin/db_import.php?db=drupal&token=2c4c8ee7eba348b4a41f0a09514e61e5
HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/php56-fpm.sock", host: "192.168.0.200"
您從192.168.0.16經socket轉fastcgi連php-fpm, 但主機卻是在192.168.0.200, socket只存在本機(192.168.0.16)中. 請使用:
fasctcgi_pass 192.168.0.200:port;
請修改以上的port.
port是TCP/IP的基本技術, 您應該要了解port.
socket不是TCP/IP的技術, 而是本機作業核心管控本機程序(processes)之間通訊的通道. socket是不能跨過本機的.
您並未提供Nginx和PHP-FPM設定檔. 只能就有限資訊分析. 但是, 您是初學者, 建議您從簡單的單機版設定Nginx-->fastcgi-->php-fpm, 不要proxy. 等熟練了, 再用Proxy拆分, 再熟練了, 再做load-balancing,..., Nginx官網和Google有很多資訊, 也有一些Nginx的書可參考, 當然要學好這些, 最重要的還是英文.
謝謝您的回答,所以我是經由Nginx的設定檔下去修改fasctcgi這樣嗎?
是, fastcgi是Nginx提供的gateway.
這是 nginx 無法把 php 轉給 php-fpm 處理的錯誤,可能是: