Skip to content

4xx Client errors

413 Content Too Large

The request body is bigger than the server accepts, usually a file upload.

Common causes

  • An upload larger than LimitRequestBody (Apache), client_max_body_size (nginx) or the LiteSpeed limit.
  • PHP's post_max_size / upload_max_filesize being smaller than the file.

How to fix a 413 error

  1. 1

    In cPanel → MultiPHP INI Editor, raise upload_max_filesize and post_max_size (post_max_size a bit larger).

  2. 2

    On nginx, raise client_max_body_size.

  3. 3

    Resize or compress images in the browser before uploading.

In Laravel

If PHP's limit is hit, Laravel throws PostTooLargeException. Add a max: rule in validation so users get a friendly message for files that are just too big.

Check the status of a URL

The first line of the response shows the status code; -L follows redirects and shows each step.

curl -I https://example.com/page
curl -IL https://example.com/old-page

Frequently asked questions

What does HTTP 413 mean?

The request body is bigger than the server accepts, usually a file upload.

How do I fix a 413 error?

In cPanel → MultiPHP INI Editor, raise upload_max_filesize and post_max_size (post_max_size a bit larger). On nginx, raise client_max_body_size. Resize or compress images in the browser before uploading.

How does Laravel handle 413?

If PHP's limit is hit, Laravel throws PostTooLargeException. Add a max: rule in validation so users get a friendly message for files that are just too big.

Get new articles in your inbox

Practical tutorials and deep dives, about once a week. No spam, unsubscribe anytime.

Privacy policy

Add DEV Talk to your Home Screen

  1. 1 Tap the Share button in Safari's toolbar.
  2. 2 Scroll down and tap Add to Home Screen.
  3. 3 Tap Add. Open it from the Home Screen to read like an app and to turn on notifications with the bell.

We use cookies to improve your experience and analyze traffic. By continuing, you agree to our Privacy Policy.