PHP upload error 1: The uploaded file exceeds the upload_max_filesize directive in php.ini
The uploaded file is bigger than PHP’s upload_max_filesize, so PHP discarded it.
exceeds the upload_max_filesize directivePOST Content-Length exceeds the limit Meaning
$_FILES['f']['error'] holds a code: 1 = over upload_max_filesize, 2 = over the form’s MAX_FILE_SIZE, 3 = partial, 4 = no file, 6 = no temp dir, 7 = can’t write to disk. If the whole POST exceeds post_max_size, $_FILES and $_POST are simply empty.
Common causes
- upload_max_filesize too small (default 2M)
- post_max_size smaller than the upload
- Missing/unwritable upload_tmp_dir (codes 6/7)
⚡ Quick fix
- Raise upload_max_filesize and post_max_size (post ≥ upload)
- Check
$_FILES['f']['error']and show a friendly message - Make sure the temp dir exists and is writable
Detailed fix by platform
PHP
upload_max_filesize = 50Mandpost_max_size = 55Min php.ini or .user.ini
How to diagnose
- Code — Value of $_FILES[...]['error']
- Limits — phpinfo() upload/post limits
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in PHP
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 13 Oct 2026