exceeds MaxRequestLen (16777216) plesk mod_fcgid unable to upload large files

So you’ve upgrade to Plesk and your users can’t upload large files any more. Upon looking at your log files, you see an fcgi error

 [warn] [client x.x.x.x] mod_fcgid: HTTP request length 16777256 (so far) exceeds MaxRequestLen (16777216)

Where is maxrequestlen (16777216) set in Parallels Plesk 11 and Ubuntu

It’s in a 2 locations… Edit the Apache2, virtualhost config and the virtual host setup files.

edit these 2 files:
/etc/apache2/mods-available/fcgid.conf
/var/www/vhosts/your_domain_name_here/conf/last_httpd_ip_default.include

and add these lines:

 <IfModule mod_fcgid.c>
   MaxRequestLen 2147483648
   FcgidMaxRequestLen 2147483648
</IfModule>

If you have other config info in your module, leave it. I’ve added 2147483648 bytes which is 2gb.

Apparently fcgid settings ARE ALSO in your virtual hosts file here:

/usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php

<?php if ($VAR->domain->physicalHosting->php || $VAR->domain->physicalHosting->phpHandlerType == 'fastcgi'): ?>
<IfModule mod_fcgid.c>
    FcgidInitialEnv PP_CUSTOM_PHP_INI <?php echo $VAR->domain->physicalHosting->vhostDir ?>/etc/php.ini
    FcgidMaxRequestLen 2147483648
</IfModule>
<?php endif; ?>

edit the FcgidMaxRequestLen value. Mine is 2gb now.

Let’s reconfigure your domain with Plesk

 /usr/local/psa/admin/bin/httpdmng --reconfigure-domain yourdomain.com

Finally, I restarted PSA and Apache2

% service apache2 restart
and
% service psa restart

Go back to your web page and you should be able to upload large files now.

mod_fcgid: HTTP request length (so far) exceeds MaxRequestLen

mod_fcgid MaxRequestLen ubuntu 12 plesk 11

16 thoughts on “exceeds MaxRequestLen (16777216) plesk mod_fcgid unable to upload large files”

  1. many Thanks for this i been looking and trying all day and the only detail you have that no one else i could find was the last bit regarding the ‘reconfigure your domain with Plesk’ and restarting of the psa.

    Much appreciated.

  2. glad it worked for you. that was the final step that finally made it work for me. fwiw, this issue has come back again on one of my domains. so, keep an eye out for it.

  3. hi,

    about this line:

    Let’s reconfigure your domain with Plesk

    /usr/local/psa/admin/bin/httpdmng

    –reconfigure-domain yourdomain.com

    should i run this in ssh?

  4. yes, run it in SSH / terminal. it reconfigures the domain with the settings. for some reason this error KEEPS happening on me. I need a permanent fix.

  5. Thank you, you are the best! Worked fine with CentOS6 and Plesk11…!!

  6. Keep an eye out, this problem pops back up after the server is reconfigured………………….. ahhh plesk!

  7. If you are running NGinx with plesk you’ll also need to edit nginxDomainVhost.php in your plesk templates/default directory.

  8. Watchout!

    /var/www/vhosts/your_domain_name_here/conf/last_httpd_ip_default.include

    states, at the top:

    #ATTENTION!
    #
    #DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
    #SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
    #
    #IF YOU REQUIRE TO APPLY CUSTOM MODIFICATIONS, PERFORM THEM IN THE FOLLOWING FILES:
    #/var/www/vhosts/your_domain_name_here/conf/vhost.conf
    #/var/www/vhosts/your_domain_name_here/conf/vhost_ssl.conf

    It would be better to change those files

  9. Thanks! I ended up switching the nginx or whatever adaptor Plesk switched to back to the Apache adaptor and haven’t had problems since. ‘knock-on-wood’

  10. Hello there!
    Thanks a lot for publish the solution.
    Just a little pik,
    /usr/local/psa/admin/bin/httpdmng –reconfigure-domain yourdomain.com didn’t work for me, I have “command not found” in the ssh console. So I used:
    /usr/local/psa/admin/sbin/httpdmng –reconfigure-domain yourdomain.com

    One more question, when I edit the last_httpd_ip_default.include file I found a legend saying this a temporal file and the changes doesn´t will be saved, how is that?

    And to the end, I don´t understand the long termn fix, because I don´t have /usr/local/psa/admin/conf/templates/custom/domain/ folder in my server. Should I have to create this?

    Thanks everybody!

  11. hy thank you, it helped me a lot, i worked on this problem 3 days ago and finaly i found your famous website

  12. Important to note if you are coming from Media temple:
    /var/www/vhosts/your_domain_name_here/conf/last_httpd_ip_default.include
    Gets overwritten on some updates: the file says to user
    your_domain_name_here/conf/vhosts.conf which works.

Leave a Reply

Your email address will not be published. Required fields are marked *