Article ID: 114842, created on Sep 26, 2012, last review on Aug 16, 2016

  • Applies to:
  • Plesk 12.5 for Linux
  • Plesk 12.0 for Linux
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Linux
  • Plesk 10.4 for Linux/Unix


When using PHP as FastCGI, if you try to upload a large file, the below error occurs and causes a '550 internal server error' or '502 Bad Gateway', if NGinx support is enabled. Apache error_log contain the following error:

mod_fcgid: HTTP request length ... (so far) exceeds MaxRequestLen (1310720)

NGinx proxy_error_log contain the following error:

upstream prematurely closed connection while reading response header from upstream


The FcgidMaxRequestLen or FcgidMaxRequestInMem directives is not large enough, causing the limit to be triggered in many cases (source). FcgidMaxRequestInMem is required to configure due to bug in Apache (bug #51747)


Edit fcgid.conffile, which is depending on your linux version could be located in /etc/httpd/conf.d/ or /etc/apache2/mods-available/

Set FcgidMaxRequestLen and FcgidMaxRequestInMem with the same values and then restart Apache.

If this value is not changing, this value may be set in the virtualhost template.

  • Change this value in the template

    # grep -ir FcgidMaxRequestLen /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php
        FcgidMaxRequestLen 16777216
    # sed -i 's/FcgidMaxRequestLen 16777216/FcgidMaxRequestLen 1073741824/g' /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php
    # grep -ir FcgidMaxRequestLen /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php
        FcgidMaxRequestLen 1073741824
  • Rebuild the virtualhost configurations.

    # /usr/local/psa/admin/bin/httpdmng --reconfigure-all
    # /usr/local/psa/admin/bin/httpdmng --reconfigure-server

Also it is possible to set this at the domain level

Domains -> domain.tld -> Apache & Nginx settings -> Additional directives for HTTP & HTTPS

<IfModule mod_fcgid.c>
    FcgidMaxRequestLen 1073741824
    FcgidMaxRequestsPerProcess 100
    FcgidProcessLifeTime 7200

Search Words


Can't upload large files


php upload large file

56797cefb1efc9130f7c48a7d1db0f0c a914db3fdc7a53ddcfd1b2db8f5a1b9c dd0611b6086474193d9bf78e2b293040 29d1e90fd304f01e6420fbe60f66f838 2a5151f57629129e26ff206d171fbb5f e335d9adf7edffca6a8af8039031a4c7 e8756e9388aeca36710ac39e739b2b37 01bc4c8cf5b7f01f815a7ada004154a2 0a53c5a9ca65a74d37ef5c5eaeb55d7f aea4cd7bfd353ad7a1341a257ad4724a 742559b1631652fadd74764ae8be475e

Email subscription for changes to this article
Save as PDF