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's 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.
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.
Related 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