Fix "413 Request Entity Too Large" (Upload Limit)
413 Request Entity Too Largeupload exceeds the maximumfile too bigA 413 means the file you're uploading is bigger than the server allows. The fix is raising the limit in the web server and PHP — both have to agree. Here is how.
Raise it in nginx
Nginx caps the request body size. Raise client_max_body_size (in the http or server block) and reload:
client_max_body_size 64M;
# then: nginx -t && systemctl reload nginx
Raise it in PHP
PHP has two limits that both must be high enough — and post_max_size should be ≥ upload_max_filesize:
upload_max_filesize = 64M
post_max_size = 64M
On a panel?
DirectAdmin/cPanel let you change the PHP values via the PHP settings/selector, and the web-server limit may be managed for you — set both there rather than editing files.
If nginx allows 64M but PHP only 8M (or vice-versa), the lower one wins and you still get an error. Raise both to the same value and restart PHP-FPM/nginx.
413 = upload too big. Raise client_max_body_size in nginx and upload_max_filesize + post_max_size in PHP, then reload.
On WordPress specifically
Even after raising server limits, WordPress's media uploader can still show its own "exceeds the maximum upload size" message if it reads a cached or lower PHP value. Check the actual limit shown on the Media > Add New screen after reloading, and confirm you edited the PHP version that's actually active — some panels run multiple PHP versions side by side.
Large file uploads timing out instead of erroring
A very large upload that's allowed by size limits can still fail if it takes longer than the request timeout. If big files fail partway through rather than being rejected outright, also check the 504 Gateway Timeout guide and raise the relevant read/execution timeouts alongside the size limits.
How to prevent upload-size errors
- Set nginx and PHP limits to the same, generous value from the start on any site handling media/files.
- Document the value somewhere so a future PHP update or panel reset doesn't quietly reset it.
- For very large files, consider chunked/resumable uploads instead of one giant request.
Related errors
If uploads fail because the account is out of space rather than a per-request size limit, that's disk quota exceeded, not a 413. If large uploads time out instead of being rejected, see 502 Bad Gateway and the 504 guide above. Migrating a large site? See how to migrate a WordPress site.
Web hosting with room to grow
Our web hosting gives you generous upload and PHP limits on fast NVMe, with DDoS protection included.
Frequently asked questions
What does "413 Request Entity Too Large" mean?
The file or request you're uploading exceeds the server's maximum allowed size. You need to raise the upload limit in both the web server (nginx) and PHP.
How do I increase the upload size limit?
Set client_max_body_size in nginx and upload_max_filesize plus post_max_size in PHP to the size you need, then reload nginx and restart PHP-FPM. Both must be high enough.
Why does it still fail after raising the PHP limit?
The web server has its own limit (client_max_body_size in nginx). If that's lower than PHP's, it blocks the upload first. Raise both to the same value.
I raised the PHP and nginx limits but WordPress still shows a low max upload size — why?
WordPress reports whichever PHP configuration is actually active for your site. If your panel runs multiple PHP versions, make sure you edited the one currently selected for your domain, then reload the Add New Media screen to confirm the new limit shows.
What's a reasonable upload limit to set?
It depends on your content — 32-64MB comfortably covers most images, PDFs and short videos. Avoid setting it extremely high "just in case," since it also increases how much memory a single malicious upload attempt can consume.
Does 413 mean my disk is full?
No — 413 is purely about a single request/file being bigger than the configured limit, regardless of how much free space you have. Running out of space entirely shows as a different error — see disk quota exceeded.
Go deeper on this
Guides and explainers that pair with this fix — from our guides and blog.
How to Speed Up a WordPress Site
Caching, images, PHP version and the hosting underneath.
ReadHow to Secure a WordPress Site
Updates, passwords, plugins and backups that actually matter.
ReadHow to Choose a Web Host
What to look for beyond the headline price.
ReadcPanel vs DirectAdmin vs Plesk
Which control panel does what, and what it costs.
ReadRelated articles
Fix "500 Internal Server Error" on Your Website
A 500 error on your site? The usual causes — .htaccess, file permissions, PHP — and how to fix them.
Read fix Web HostingHow to Point a Domain to Your Server (DNS A Record)
How to point a domain at your server with an A record — and why it doesn't work instantly.
Read fix Web HostingFix Email Going to Spam (SPF, DKIM & DMARC Explained)
Mail landing in spam? Set SPF, DKIM and DMARC correctly so your email reaches the inbox.
Read fix