Website on Plesk server is not accessible: 504 Gateway Time-out: The timeout specified has expired:

Website on Plesk server is not accessible: 504 Gateway Time-out: The timeout specified has expired: [client 203.0.113.2:54693] AH01075: Error dispatching request to
Avatar Julian Bonpland Mignaquy
Updated 5 months ago
Applicable to: Plesk for Linux
Symptoms
Website example.com is not accessible. The following error is shown in a browser:

504 Gateway Time-out

The following error message appears in the domain error log file at Domains > example.com > Logs:

[proxy_fcgi:error] [pid 42290:tid 140458047010560] (70007)The timeout specified has expired: [client 203.0.113.2:54693] AH01075: Error dispatching request to :, referer: http://example.com/gallery

In Plesk > Domains > example.com > PHP Settings it is shown that the website uses “FastCGI” or “FPM” PHP handler.

Cause
Execution PHP code of the website takes longer than the specified timeout.

Resolution
To fix the issue increase the timeout. FastCGI limits can be increased for an affected domain only or on a server-wide level. Both ways are described below.

Note: If after increasing the FastCGI limits the same error appears, try to increase the value of the limits to 1200 seconds. If it does not help, review and optimize the website code.

Note: In case it is necessary to run only one script with the increased timeout, consider running it in a scheduled task: How to schedule a task in Plesk for Linux?

Increasing the FastCGI limits for a single domain

Log into Plesk

In Plesk, go to Domains > example.com > Apache & nginx Settings.

Add the following lines to the text boxes Additional directives for HTTP and Additional directives for HTTPS:

FcgidIdleTimeout 600
FcgidProcessLifeTime 600
FcgidConnectTimeout 600
FcgidIOTimeout 600

Note: If the website still shows “504 Gateway Timeout” try increasing timeouts to higher values.

Example:

If FPM PHP handler is used, append additional two lines to the Additional directives for HTTP/Additional directives for HTTPS text boxes. The resulting set of Apache directives will be the following:

FcgidIdleTimeout 600
FcgidProcessLifeTime 600
FcgidConnectTimeout 600
FcgidIOTimeout 600
Timeout 600
ProxyTimeout 600

Click OK button to apply the changes

Increasing the FastCGI limits server-wide
Connect to the Plesk server via SSH as root user.

Open the FastCGI configuration file fcgid.conf in a text editor. Use the guide for “vi” editor, if required. Location of the file depend on operating system:

for CentOS/RHEL/CloudLinux distributions:

/etc/httpd/conf.d/fcgid.conf

for Debian/Ubuntu distributions:

/etc/apache2/mods-enabled/fcgid.conf

Increase FastCGI timeout limits as shown below:

FcgidIdleTimeout 600
FcgidProcessLifeTime 600
FcgidConnectTimeout 600
FcgidIOTimeout 600

If FPM PHP handler is used create /etc/httpd/conf.modules.d/00-proxy_timeout.conf then add the following lines into it:

Timeout 600
ProxyTimeout 600

Test configuration with “apachectl configtest” command, and it should return the following:

apachectl configtest
Syntax OK

Restart Apache:

for CentOS/RHEL-based operating systems:

service httpd restart

for Debian/Ubuntu-based operating systems:

service apache2 restart

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值