# PHP upload error 1: The uploaded file exceeds the upload_max_filesize directive in php.ini

**Code:** `UPLOAD_ERR_INI_SIZE` · **Category:** PHP · **Seen on:** PHP

The uploaded file is bigger than PHP’s upload_max_filesize, so PHP discarded it.

## 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

1. Raise upload_max_filesize and post_max_size (post ≥ upload)
2. Check `$_FILES['f']['error']` and show a friendly message
3. Make sure the temp dir exists and is writable

## Detailed fix by platform

### PHP

1. `upload_max_filesize = 50M` and `post_max_size = 55M` in php.ini or .user.ini

## How to diagnose

1. **Code** — Value of $_FILES[...]['error']
2. **Limits** — phpinfo() upload/post limits

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/php/upload-err-ini-size)
