Resolving the “413 Request Entity Too Large” Error

Go Back to Main Knowledgebase

If you encounter the “413 Request Entity Too Large” error while uploading files to your web server, it means that the size of the client’s request exceeds the server’s file size limit. This error is typically triggered when someone tries to upload a large file to the server, and the server responds with a 413 error to indicate that the request entity is too large.

If you encounter the “413 Request Entity Too Large” error while uploading files to your web server, follow these steps to resolve it:

Modify PHP.ini:

  1. Access your cPanel and select “MultiPHP INI Editor” under “Software”.
  2. Choose your domain from the dropdown menu.
  3. Adjust the following parameters:
    • max_execution_time (maximum upload time in seconds)
    • upload_max_filesize (maximum upload size in megabytes)
    • post_max_size (maximum post size in megabytes)
  4. Click “Apply”.

Modify .htaccess:

  1. Access your cPanel and select “File Manager” under “Files”.
  2. Locate the .htaccess file in your root WordPress directory.
  3. Edit the file and add the following code at the bottom:
    php_value upload_max_filesize 64M
    php_value post_max_size 64M
    php_value max_execution_time 300
    php_value max_input_time 300
  4. Save the changes.

Modify functions.php:

  1. Access your cPanel and select “File Manager” under “Files”.
  2. Navigate to the folder of your current WordPress theme inside the root directory.
  3. Edit the functions.php file.
  4. Add the following code at the end of the file:
    @ini_set('upload_max_size', '64M');
    @ini_set('post_max_size', '64M');
    @ini_set('max_execution_time', '300');
  5. Save the changes.

 

If you still encounter the “413 Request Entity Too Large” error after following these steps, it could be due to other factors:

  • CDN Restrictions: The error may be caused by restrictions imposed by your Content Delivery Network (CDN) servers or your hosting provider. Contact your hosting support to check if you’ve exceeded your plan’s file size limit or if there are any other configuration issues.
  • CDN File Size Limits: If you use a CDN to enhance your site’s performance, the CDN servers may have file size limits that are too small. In such cases, refer to the documentation provided by your CDN provider or contact their support for assistance.

By applying these solutions, you can increase the file size limits and successfully resolve the “413 Request Entity Too Large” error while uploading files to your web server.

Note: Make sure to adjust the values according to your specific requirements.

Remember to create backups of your server files before making any changes to ensure you can revert to the previous configuration ifneeded.

0
263