413 request entity too large, how to fix it



The 413 Requesting entity's too-large error indicates that although the server is aware of the client's request, it cannot handle it due to its size. This error message typically shows up when submitting forms with a lot of data or uploading huge files. Let's understand the reason and methods to fix it. 

What is the “413 request is too large” error?

The “413 request entity is too large” error occurs because the payload size exceeds the server's configured limit and the server can not manage the request made. As a result, the browser window starts displaying “ 413 request entity too large.” 

This kind of error occurs when the size of the files exceeds the limit or when sending an extensive request to the server. Before sending files, it is advisable to compress the files, split the large files into small ones, and follow document-specific guidelines. 

What are the reasons for the 423 request entity’s too-large error? 

When the server refuses to process a request because its payload exceeds the server's predefined limits. The following are the key reasons for this error: 


  1. Exceed the payload size: When the client requests to send a file with a payload that exceeds the server’s maximum allowed size.

  2. Misconfigured server configuration: 

  3. Insufficient server configuration: Generally, servers are configured with a request limit. If the limit is exceeded, the error will be triggered. 

  4. Lack of data compression: Sometimes, client applications may not properly segment or compress data before sending it, leading to an oversized request. This misconfiguration can cause the payload to exceed the server's capacity.  

  5. Outdated server software: Older versions of software may not be able to handle large requests efficiently, making this error more likely to occur during high data loads.

How to fix it  

  1. Reset file permission: 

Hostinger users can easily do so from cPanel. Navigate to Websites → Advanced → Fix File Ownership, check the box confirming you want to reset file permissions, and then hit Execute.

           Fixing file ownership will reset permissions to the following values:

  • 644 for files: the owner can read and write, while the group and others can only read.

  • 755 for folders:  the owner can read, write, and execute, while the group and others can only read and execute.


  1. Manually upload the file through FTP: 

       Users of Hostinger can change the hPanel maximum file upload size limits. Here’s how:

  • Go to Websites → Advanced → PHP Configuration from the cPanel dashboard.

  • Open the PHP Options tab, containing your website’s PHP configuration settings. 

  • Scroll down to the memory limit field and increase the script’s maximum memory usage. In this example, our Cloud Professional hosting plan offers up to 6144 MB.

  • Find the postMaxSize field and change the largest size that is permitted for all requests, including file uploads, after that. Ideally, the value should be smaller than the memory limit to ensure the server can handle multiple requests and tasks that need extra memory.

  • In the uploadMaxFilesize field, finally, enter the new maximum file upload size. To prevent problems when uploading files, make sure the value is less than postMaxSize.

  • Save to confirm the changes.

  1. Modify the functions.php file: 

  • Open your WordPress root directory using a File Manager or an FTP client. Double-click the .htaccess file to edit it. If you can’t find it, check our guide for steps to locate or create an .htaccess file. 

  • Add the following code snippet below the # END WordPress line.

php_value upload_max_filesize 256M

 php_value post_max_size 256M

 php_value max_execution_time 600

  • Save the change. 

  1.  Adjust the NGINX configuration: WordPress websites hosted on virtual private servers can also be resolved by adjusting the web server configuration.

How to avoid it 

  1. Adjust the size: check the file size limit and adjust it before uploading them. Use image optimization techniques like lossy and lossless compression to reduce the file size and eliminate the triggering of the error. In the meantime, video compression without sacrificing quality can be assisted by programs like HandBrake and DaVinci Resolve.

  2. Check server settings regularly: When you add a new function that sends large requests, adjust your server’s configuration settings to ensure they can handle them. Better yet, always test new features in a WordPress staging environment to avoid errors affecting your live website.

Hostinger users on WordPress Business and cloud hosting plans can quickly set up a staging website from the hosting control panel. Go to Websites → WordPress → Staging and select Create staging. The process takes several minutes to complete and doesn’t require coding.

  1. Enable chunked uploads: it helps to break the files into smaller parts and avoid the maximum request size limit. This method also enhances the reliability of your upload process. The simplest method to activate this function is to install a Big File Uploads or any WordPress file upload plugin.

  2. Use a Content Delivery Network (CDN): it reduces the load by caching and serving content from servers around the world. Caching minimizes server load and errors associated with large requests by keeping copies of the files on your site closer to users.

Advantages of our Windows Server Support Service with SupportFly

  • Operating system support 

  • System Administration

  • 24/7 Monitoring

  • Performance Tuning

  • Backup and Disaster Recovery

  • Security Management


Conclusion 

This blog discussed all the possible aspects related to 413 request entities being too large. Take precautions to avoid the 413 error. Resolving the “413 Request Entity Too Large” error in WordPress involves a systematic approach, starting with the least intrusive methods and progressing to more direct server configuration adjustments if needed. Each method focuses on increasing the maximum file upload size, either through WordPress settings or by modifying server configuration files. However, if it occurs, follow the steps discussed in the blog.

If you are facing 413 request entity too large errors on your website, then follow these steps, and for more details, reach out to our expert team. 


SHARE

Manish Lakhera

Best Server Support Management Company

  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment