How to fix FastCGI timeout issues in Plesk?
Asked Answered
M

5

9

PHP support is currently set to: run as Fast CGI.

I keep getting these errors in my server log:

mod_fcgid: read data timeout in 45 seconds

Premature end of script headers: index.php

Should be quick fix I think, but I cant find the file to edit. Is this something I can change from Plesk.

Anyone know how to increase the timeout?

Majoriemajority answered 16/12, 2012 at 20:3 Comment(1)
You can check this answer: #14489067Hann
A
7

In Plesk 12.x and similar go to Web Server Settings and set the following directives:

Additional directives for HTTP & HTTPS

FcgidBusyTimeout 300
FcgidIOTimeout 250

Above lines will change the timeout for scripts that are quiet too long and take too long to execute.

Additional nginx directives

proxy_read_timeout 300;

Above lines will change the proxy timeout.

If the problem persist, increase the values.

See also: Premature end of script headers: index.php, mod_fcgid: read data timeout


Check the screenshots for the guidance:

Plesk 12.x - Web Server Settings - Additional Apache directives: Additional directives for HTTP & HTTPS - FcgidBusyTimeout & FcgidIOTimeout

Plesk 12.x - Web Server Settings - Additional nginx directives - proxy_read_timeout

Affidavit answered 6/4, 2016 at 23:34 Comment(0)
M
5

A solution provided in the forum of Plesk by Parallels staff

Edit the file:

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

Specifically, change

FcgidIOTimeout 45

to

FcgidIOTimeout 3600

3600 seconds = 1 hour. Should be long enough for most but adjust upwards if required. I saw one example quoting 7200 seconds in there.

Finally, restart Apache to make the new setting active.

apachectl graceful

Hope it helps

R

Melanoma answered 13/12, 2013 at 12:9 Comment(1)
If I'm not mistaken, he doesn't want to raise timeout but prevent FCGI from timing out.Plusch
B
1

My solution to this was to change the PHP settings in the plesk control pannel as per the screenshot.PHP Settings

Blancablanch answered 19/10, 2015 at 10:25 Comment(1)
Why don't you provide solution here, in answer? It'd be much more convenient.Clementia
C
0

In the new version of Plesk the fcgid.conf file has moved to:

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

I had some issues importing an xml file into wordpress. It kept on giving a 500 Internal Error. The error log showed:

[Wed Jul 26 13:18:00.219226 2017] [fcgid:warn] [pid 4751] [client 145.97.205.8:60155] mod_fcgid: read data timeout in 45 seconds

[Wed Jul 26 13:18:00.219505 2017] [fcgid:warn] [pid 4751] (110)Connection timed out: [client 145.97.205.8:60155] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function

After following some advice - as the PHP.INI settings made no difference - i changed some settings as advised:

Original:

FcgidIOTimeout 45

To:

FcgidIOTimeout 3600

Also added:

<IfModule mod_fcgid.c>
FcgidMaxRequestsPerProcess 500
<IfModule !mod_fastcgi.c>

Worked like a charm. Thank you for your help.

Chopstick answered 26/7, 2017 at 11:41 Comment(0)
C
0

After changing max_execution_time = 3600 in /etc/php.ini solved my problem.

Compound answered 12/4, 2020 at 19:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.