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 个次序反过来了***