Plesk

Unable to upload large files via PHP on Plesk server: HTTP request length exceeds MaxRequestLen

Symptoms

Cause

The FcgidMaxRequestLen and/or FcgidMaxRequestInMem directive values are insufficient.

Resolution

Server-wide

This only works with FPM application served by Apache, otherwise use custom templates

  1. Connect to the server via SSH.

    Note: if direct SSH access to the server is not possible, contact server administrator for further assistance.

  2. Edit fcgid.conf file which is located in /etc/httpd/conf.d/ (for RHEL based OS) or /etc/apache2/mods-available/ (for Debian based OS).

  3. Set FcgidMaxRequestLen and FcgidMaxRequestInMem with the same values in bytes. For example, 1024 MB corresponds to 1073741824 B.

  4. Restart Apache:

    For RHEL-based OS

    # service httpd restart

    For Debian-based OS:

    # service apache2 restart

Warning: restarting Apache would cause downtime for the hosted domains  

For specific domains

  1. Log in to Plesk

  2. Go to Domains > example.com > Apache & Nginx settings > Additional directives for HTTP & HTTPS and add the following lines:

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