Apache2 - mod_fcgid: HTTP request length exceeds MaxRequestLen

Want to support HowtoForge? Become a subscriber!
Submitted by falko (Contact Author) (Forums) on Thu, 2011-08-18 11:18. :: Errors

Error: Apache2 - mod_fcgid: HTTP request length exceeds MaxRequestLen

You try to upload a file through http to your web site running on Apache2/PHP5/mod_fcgid, and in your browser you get the error:

Error 500, Internal server error

In Apache's error log you see something like

[Thu Jan 27 15:14:15 2011] [warn] [client] mod_fcgid: HTTP request length 131484 (so far) exceeds MaxRequestLen (131072), referer: ...



First check in your php.ini that upload_max_filesize has a big enough value for your upload. By default it's

upload_max_filesize = 2M

(2 MB)

Then open your Apache vhost configuration and add the FcgidMaxRequestLen directive with a big enough value (in bytes), for example

FcgidMaxRequestLen 2000000

which equals roughly 2 MB.

The default value is

FcgidMaxRequestLen 131072

which is very small (see http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#fcgidmaxrequestlen).

Finally restart Apache.

Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Iredoo (not registered) on Fri, 2014-01-24 03:37.

Just wanted to let you know what I did on centos 6.4.

 Found the file  /etc/httpd/conf.d/fcgid.conf

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

 and added the line

 FcgidMaxRequestLen 2000000

 Then restart the apache service.

Submitted by catalinggo (not registered) on Tue, 2013-07-16 20:39.

if you are using ispconfig3

#cd /etc/apache2/mods-available

#nano fcgid.conf

adding on new line "FcgidMaxRequestLen 51200000"

<IfModule mod_fcgid.c>
  AddHandler    fcgid-script .fcgi
  FcgidConnectTimeout 20
  FcgidMaxRequestLen 51200000

#/etc/init.d/apache2 restart

And try to upload again :)


Submitted by entelesis (not registered) on Thu, 2013-06-20 00:17.

nano /etc/apache2/mods-available/fcgi.load

LoadModule fcgid_module /usr/lib/apache2/modules/mod_fcgid.so

# add the following lines

<IfModule fcgid_module>
FcgidMaxRequestLen 51200000

/etc/init.d/apache2 reload

works for all virtual hosts using fcgi.


Submitted by daf647 (registered user) on Sun, 2013-02-03 20:40.

I have directly this problem. I made higher upload_max_filesize in php.ini but it doesn't help. I want realize the 2nd step but I can't find Apache vhost configuration file. 

/etc/apache2/mods-enable/fcgid.conf  doesn't exist 

Where is the vhost configuration file in Linux vmxxxx.wedos.net 2.6.32-71.29.1.el6.x86_64 #1 SMP Mon Jun 27 19:49:27 BST 2011 x86_64 x86_64 x86_64 GNU/Linux



Submitted by Anonymous (not registered) on Tue, 2012-06-19 19:28.
after changing the FastCGI conf just reload Apache is sufficient, no need to restart it
Submitted by Stone1555 (not registered) on Thu, 2011-08-18 15:59.

Could you tell us which file to add this change to?


"Then open your Apache vhost configuration and add the FcgidMaxRequestLen directive with a big enough value "


Sorry if this a little elementry