Symptoms
-
Unable to upload a file using an web application or webmail, the following error is shown:
An error occurred!
File upload failed -
On uploading a big file via WordPress administrator interface, the following error is shown:
Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page.
-
The following error can be seen in the browser’s console:
413 Request Entity Too Large
Cause
Webserver limits maximum filesize to be uploaded.
Resolution
-
Adjust the following settings of PHP handler assigned to the domain in Tools & Settings > PHP Settings > X.X.XX FPM application in php.ini tab:
post_max_size 2000m
upload_max_filesize 2000m -
Perform the following steps depending on the webserver serving PHP handler in Tools & Settings > example.com > PHP Settings
For case PHP is served by nginx
-
Connect to the server via SSH.
-
Add the following directives to
/usr/local/psa/admin/conf/panel.ini
file using ‘vi’ utility to customize Plesk defaults:[webserver]
nginxClientMaxBodySize = 2000mIf there is no
/usr/local/psa/admin/conf/panel.ini
file, create it from the sample file:# cp /usr/local/psa/admin/conf/panel.ini.sample /usr/local/psa/admin/conf/panel.ini
-
Rebuild web server configuration files:
# plesk repair web -server
-
Reload nginx:
# service nginx reload
For case PHP is served by Apache
-
Backup the main Apache configuration file:
-
On RedHat/CentOS/CloudLinux operating systems:
# cp /etc/httpd/conf/httpd.conf{,.orig}
-
On Debian/Ubuntu operating systems:
# cp /etc/apache2/apache2.conf{,.orig}
-
-
Open the file from step 2. and add or modify the parameter
LimitRequestBody
to the required value in bytes, for example:LimitRequestBody 2147483647
Note: The maximum value of the parameter LimitRequestBody is 2147483647 (2 gigabytes).
-
Reload Apache configuration to apply changes:
-
On RedHat/CentOS/CloudLinux operating systems:
# service httpd reload
-
On Ubuntu/Debian operating systems:
# service apache2 restart
-
-