Apache proxfy_fcgi - Error dispatching request to Apache proxfy_fcgi - Error dispatching request to apache apache

Apache proxfy_fcgi - Error dispatching request to


I was having the same problem, turns out Apache has module that handles timeouts called mod_reqtimeout

The default value (you won't see it in the default http.conf) is:

RequestReadTimeout handshake=0 header=20-40,MinRate=500 body=20,MinRate=500

In my case I was uploading a file through a plain HTML form submission, so the file is technically part of the header and the default configuration says that the header will timeout at 20 to 40 seconds. The 20-40 thing is pretty cool because it will timeout at 20 seconds but if 500 bytes are sent in a second, it will add an additional second of wait time until it reaches 40 seconds and then timeout no matter what.

I upload larger files in my website so I added this line to my httpd.conf file:

RequestReadTimeout handshake=0 header=20-600,MinRate=500 body=20,MinRate=500

So as long as my user is sending data at a minimum of 500 bytes/s, the request will not time out until a max. of 600 seconds is reached (better read the documentation, don't quote me on the throughput rate)

It's actually a pretty cool Apache module but not super well known as people recommend to change other apache timeout settings in other similar "The timeout specified has expired:" problems related to PHP-FPM but this problem happens with any post that takes more than 40 seconds to be submitted by default in Apache.


For me a restart of php-fpm did the job. After looking in the log as @varlogtim adviced. The log showed that there was no activity for the last 12 hours...


It appears that your PHP code is taking longer than the configured timeout to complete. When apache loads a PHP page using fcgi it sends the request of to PHP-FPM service to be processed. If PHP-FPM takes too long to respond then you will see this type of timeout. Possible causes are; your PHP code could be stuck in a loop, or waiting on a response from a database that is taking a particularly long time.

To troubleshoot I would use the CLI version of php to see if the script completes in a reasonable amount of time ($ time php /path/to/file.php). There may additional information in the PHP-FPM log (default: /var/log/php-fpm.log).