BloggingBIG Logo
Search
  • Blogs
  • How we work
  • Write Guest Post
Get started

HTTP Status Code 413 – Request Entity Too Large And Ways To Fix It

by Kedar Dangal

  • 6 min read
    • HTTP Status
Share this content
HTTP Status Code 413 – Request Entity Too Large And Ways To Fix It image

The HTTP Status Code 413 indicates that the client’s request is too large for the server to handle.

The server refuses to perform a request because the request payload exceeds the server’s willingness or ability to handle it.

To prevent the client from continuing the request, the server may disconnect the connection.

If the situation is just temporary, the server should produce a Retry-After header field to indicate that it is only temporary and that the client may try again after a certain amount of time has passed.

Navigation

  • What does 413 Request Entity Too Large mean?
  • Status
  • Specifications
  • 413 Code References
  • How to Fix a “413 Request Entity Too Large” Error?
    • WordPress
      • Make changes to PHP.ini.
      • Modify .htaccess
      • Modify functions.php
    • Nginx Server
    • Apache Server
  • FAQs
    • How do I resolve 413?
    • What is a 413 response?
    • How do I fix Nginx 413 Request Entity Too Large?
  • Conclusion

What does 413 Request Entity Too Large mean?

A 413 Request Entity Too Large error happens when a client’s request is too large for the webserver to handle.

Clients may receive a 413 Request Entity Too Large response if your web server sets a specific HTTP request size restriction.

A client attempting to upload a huge file to the server is an example of a request that might result in this error (e.g. a large media file).

http status code 413
credit: www.keycdn.com

The sort of web server you’re running will dictate which directives you’ll need to set up. The next section will show you how to prevent people from uploading excessively big files to your web server or increase the upload size restriction.

Status

413 Payload Too Large

Specifications

SpecificationTitle
RFC 7231, section 6.5.11: 413 Payload Too LargeHypertext Transfer Protocol (HTTP/1.1): Semantics and Content

413 Code References

Rails HTTP Status Symbol :request_entity_too_large

Go HTTP Status Constant http.StatusRequestEntityTooLarge

Symfony HTTP Status Constant Response::HTTP_REQUEST_ENTITY_TOO_LARGE

Python2 HTTP Status Constant httplib.REQUEST_ENTITY_TOO_LARGE

Python3+ HTTP Status Constant http.client.REQUEST_ENTITY_TOO_LARGE

Python3.5+ HTTP Status Constant http.HTTPStatus.REQUEST_ENTITY_TOO_LARGE

How to Fix a “413 Request Entity Too Large” Error?

Your server’s default upload size limit is determined by how it is configured. We’ll teach you how to resolve a 413 error by increasing your size limit using a WordPress setup as well as an Apache or Nginx server configuration in this post.

Because all of the approaches entail changes to your server data, we recommend making a backup before proceeding.

WordPress

The 413 error is frequently caused by themes and plugins in the WordPress content management system. Fortunately, there are a few options for increasing your WordPress upload size limit to allow these larger files to pass. You can attempt any of the following as long as you don’t go over your hosting plan’s limits:

Make changes to PHP.ini.

Modifying your server’s PHP.ini file is the simplest way to boost your upload limit. You may modify your limit without coding using the cPanel interface. To do so, follow these steps:

1. In the cPanel menu, select MultiPHP INI Editor under Software.

2. Then appears, choose your domain from the dropdown menu.

3. Change the values as your requirements:

  • max_execution_time (maximum time to upload, in seconds)
  • upload_max_filesize (maximum upload size, in megabytes)
  • post_max_size (maximum post size, in megabytes)

4. After finishing, click Apply.

Modify .htaccess

If your WordPress site is hosted on an Apache server, you may boost the server’s limit using .htaccess, which is a file that includes various server directives.

Modify functions.php

You may also try raising your size limit in your existing WordPress theme’s functions.php file.

We recommend that you attempt the preceding methods first if you want to make this change permanent. You’ll need to edit functions.php every time you update or change your current theme if you use this method.

1. Select File Manager from the Files menu in your cPanel.

2. Go to the current theme’s folder in your WordPress root directory (public HTML by default). The theme file should be opened.

3. Click the Edit icon next to functions.php.

4. Copy and paste the code below 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. Click Save.

The size of your WordPress uploads and posts is limited to 64 megabytes with this code. You can adjust this quantity to something larger or lower if necessary, as long as you don’t go over the storage limit of your hosting plan.

It also limits the duration of your uploads to 300 seconds.

Nginx Server

Nginx server settings may be changed in the nginx.conf file. Look for the directive client max body size in this file. Then adjust the value (in megabytes) to your preferred maximum file size.

If this directive does not appear in nginx.conf, add it at the end of a server, location, or HTTP block as follows:

server {
          ...
          client_max_body_size 64M;
}

A 64-megabyte upload is now possible. Set this number to your liking, save the file, and then reload Nginx to see the changes.

Apache Server

To change the size limit on an Apache server, edit the.htaccess file as follows:

1. In your cPanel menu, select File Manager in Files.

2. In your root WordPress directory (public_html by default), locate .htaccess. The .htaccess file at first may be hidden.

3. Select .htaccess and click the Edit icon.

4. Copy and paste the code in .htaccess file given below:

php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300

5. Finally, Click Save and reload Apache.

This reduces the maximum file upload size to 64 megabytes and the maximum upload time to 300 seconds for your WordPress uploads and articles. Both of these variables can be changed to your liking.

Credit: Digital Suncity – Free Tutorials

FAQs

How do I resolve 413?

Fixing HTTP Status Code 413 Error:
You can fix this error by increasing the upload file size capacity. Just be careful to not exceed the limits set by your hosting plan.

What is a 413 response?

The HTTP Status Code 413 indicates that the client’s request is too large for the server to handle.

How do I fix Nginx 413 Request Entity Too Large?

You can fix the Nginx 413 Request Entity Too Large error by adding the following code in your nginx.conf file:
server {    
  …          
client_max_body_size 64M;
}

Conclusion

That should cover all the bases when it comes to HTTP Status code 413-Request Entity Too Large issues.

While there isn’t always much you can do when you get a 413 error, maybe some of these tips will come in handy the next time you get one. I hope this article was able to help you with your doubts and queries related to the HTTP status code 413(Request Entity Too Large ).

Still, if there are any queries related to this topic, feel free to ask in the comment section, we would be happy to assist you. Thank you.

Related post:

HTTP Status Code 300-Multiple Choices

HTTP Status Code 302 Found

HTTP Status Code 204 – No Content

HTTP Status Code 203 – Non-authoritative Information

HTTP Status Code 207 Multi-Status

HTTP Status Code 208 Already Reported

HTTP Status Code 400 Bad Request

HTTP Status Code 401 Unauthorized

HTTP Status Code 403 Forbidden Error

HTTP Status Code 404 Not Found

HTTP Status Code 405 Method Not Allowed

HTTP Status Code 409 Conflict

HTTP Status Code 411 Length Required

Share
Tweet
Share
0 Shares
Kedar Dangal image

Kedar Dangal

Making a difference, Adding the sum.

Be first to comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

More from HTTP Status

HTTP Status Code 499 Client Closed Request image

HTTP Status Code 499 Client Closed Request

Kedar Dangal image

by Kedar Dangal

  • 4 min read
    • HTTP Status
HTTP Status Code 431 Request Header Fields Too Large image

HTTP Status Code 431 Request Header Fields Too Large

Kedar Dangal image

by Kedar Dangal

  • 4 min read
    • HTTP Status
HTTP Status Code 429-Too Many Request image

HTTP Status Code 429-Too Many Request

Saurabh Chalise image

by Saurabh Chalise

  • 4 min read
    • HTTP Status

Quick links

  • Siteground black friday deals
  • Wp engine black friday deals
  • Greengeeks black friday deals
  • Tmd hosting black friday deals
  • Fastcomet black friday deals
  • Hostwinds black friday deals
  • bluehost black friday
  • Namecheap black friday deals
  • Ionos 1 & 1 black friday deals
  • Hostgator black friday deals
  • ipage black friday deals
  • wpx hosting black friday deals
BloggingBIG logo
  • About
  • DISCLAIMER
  • Disclouser for Blogging BIG
  • Terms and Conditions
  • Privacy Policy
  • Sitemap
Developed by Fnclick
Back To Top