LNMP (Nginx + PHP - FPM) 出现 execution timeout 或 504 Gateway Time-out 的解决办法

yufei       1 年, 6 月 前       500

在 LNMP 构架下,有些长时间执行的请求可能会出现超时,具体在浏览器端就是

504 Gateway Time-out

如果看 php-fpm 的日志,可能就是

child 1185185, script 'index.php' (request: "POST ") execution timed out (131.145749 sec), terminating

这时候,只要修改下面2个地方即可

1. php-fpm.conf

max_execution_time = 300

单位是秒

2. www.twle.cn.comf

location ~ \.php$ {
    include /etc/nginx/fastcgi_params;
        fastcgi_pass  unix:/var/run/php5-fpm.sock;

    fastcgi_read_timeout 300; 
}

添加 fastcgi_read_timeout 300; 单位是秒

目前尚无回复
简单教程 = 简单教程,简单编程
简单教程 是一个关于技术和学习的地方
现在注册
已注册用户请 登入
关于   |   FAQ   |   我们的愿景   |   广告投放   |  博客

  简单教程,简单编程 - IT 入门首选站

Copyright © 2013-2022 简单教程 twle.cn All Rights Reserved.