Articles in this section

Unable to upload large files to website hosted on Plesk for Linux server: End of script output before headers

Plesk for Linux kb: technical ABT: Group A

Applicable to:

  • Plesk for Linux

Symptoms

  • Uploading large files to a website hosted on a Plesk for Linux server (for example, via WordPress Media Library) fails:

    PLESK_INFO: HTTP error

  • The following error is found in Domains > example.com > Logs or in the file /var/www/vhosts/example.com/logs/error_log:

    CONFIG_TEXT: [core:error] [pid 4820] [client 203.0.113.2:33236] End of script output before headers: sdn_data.php, referer:

  • All necessary limits are set correctly in Domains > example.com > PHP Settings (they are saved in the domain's PHP configuration file):

    # grep -e 'memory_limit' -e 'upload_max_filesize' -e 'post_max_size' -e 'file_uploads' /var/www/vhosts/system/example.com/etc/php.ini
    file_uploads = on
    upload_max_filesize = 256M
    post_max_size = 256M
    memory_limit = 256M
    max_file_uploads = 20

  • The communication timeout limit has a sufficient value in the Apache configuration file /etc/httpd/conf.d/fcgid.conf:

    # grep 'FcgidIOTimeout' /etc/httpd/conf.d/fcgid.conf
    FcgidIOTimeout 320

Cause

The directive LimitRequestBody is define in the Apache configuration, domain's Apache & nginx Settings, or in the file .htaccess.

The directive LimitRequestBody specifies the number of bytes from 0 (meaning unlimited) to 2147483647 (2GB) that are allowed in a request body.

Resolution

For one domain
  1. Log into Plesk.

  2. Increase the value of the parameter LimitRequestBody where it specified:

    • in Apache directives: Domains > example.com > Apache & nginx Settings > Additional Apache directives:

    • in the file .htaccess: Domains > example.com > File Manager > .htaccess:

For all domains
  1. Connect to the server using SSH.

  2. Open the Apache configuration file for editing:

    • /etc/httpd/conf/httpd.conf on CentOS, RHEL, CloudLinux.
    • /etc/apache2/apache2.conf on Ubuntu and Debian.
  3. Increase the value of the parameter LimitRequestBody and save the file:

    CONFIG_TEXT: LimitRequestBody 2147483647

  4. Restart Apache to apply the changes:

    • on CentOS, RHEL, CloudLinux:

      # service httpd reload

    • on Ubuntu and Debian:

      # service apache2 reload

Additional information

Apache HTTP Server - LimitRequestBody Directive

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.