Symptoms
-
Uploading large files to a website hosted on a Plesk for Linux server (for example, via WordPress Media Library) fails:
HTTP error
-
The following error is found in Domains > example.com > Logs or in the file
/var/www/vhosts/example.com/logs/error_log
:[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
-
Increase the value of the parameter
LimitRequestBody
where it specified:
For all domains
-
Connect to the server using SSH.
-
Open the Apache configuration file for editing:
-
/etc/httpd/conf/httpd.conf
on CentOS, RHEL, CloudLinux. -
/etc/apache2/apache2.conf
on Ubuntu and Debian.
-
-
Increase the value of the parameter
LimitRequestBody
and save the file:LimitRequestBody 2147483647
-
Restart Apache to apply the changes:
-
on CentOS, RHEL, CloudLinux:
# service httpd reload
-
on Ubuntu and Debian:
# service apache2 reload
-