504 Gateway Time-outphp
http://www.scalescale.com/tips/nginx/504-gateway-time-out-using-nginx/ https://www.jb51.cc/nginx/69483.htmlhtml
他們講解了一些原理性的東西,最終也沒有附上本身的 nginx 版本和實際操做記錄nginx
服務器上沒有拿準具體修改哪裏,是不敢貿然動手的! nginx 版本在變化,有些配置文件內容甚至文件名都不同web
比方說:我修改了 phh.ini 的 fastcgi_connect_timeout 到 300 以後,在重啓 nginx 服務的時候,就出現瞭如下錯誤sql
Failed to start A high performance web server and a reverse pro ~apache
只好改回去,想好了再動手!vim
查看版本號和配置位置 $ nginx -v nginx version: nginx/1.10.3 (Ubuntu)服務器
$ whereis php php: /usr/bin/php /usr/bin/php7.0php7
修改 nginx 網站配置 $ vim phpmyadmin.conf 在 php 處理部分加上如下 3 個參數socket
location ~ \.php$ { include snippets/fastcgi-php.conf; # # # With php7.0-cgi alone: # fastcgi_pass 127.0.0.1:9000; # # With php7.0-fpm: fastcgi_pass unix:/run/php/php7.2-fpm.sock; # by wzh 20190713 for 504 Gateway Time-out # /etc/php/7.2/fpm/php.ini also change fastcgi_connect_timeout 200; fastcgi_send_timeout 200; fastcgi_read_timeout 200; }
修改 php.ini $ cd /etc/php/7.2/fpm $ sudo vim php.ini 找到以上 3 個參數值,對應修改如下
;by wzh 20190713 30 --> 200 ,same to max_execution_time max_execution_time = 200 ; by wzh 20190713 60-->200 default_socket_timeout = 200 ;by wzh 20190713 30 --> 200 ,same to max_execution_time max_execution_time = 200
****** 實際過程當中,php.ini 是先修改的,這裏爲了寫做方便對照,把這 2 個次序反過來了***