Introduction
When WordPress says the uploaded file exceeds upload_max_filesize, the media library is not the real problem. PHP is rejecting the request before WordPress can process it fully. The fix is to change the active PHP limits in the layer your hosting stack actually uses, then confirm the new values apply to the same runtime that serves WordPress.
Symptoms
- WordPress blocks media uploads with an
upload_max_filesizeerror - Large theme, plugin, or backup uploads fail while small files still work
- The upload limit shown in Site Health or media screens is lower than expected
- Editing
php.iniappears to change nothing - The issue started after moving hosts, changing PHP versions, or switching control panels
Common Causes
upload_max_filesizeis set lower than the file you are trying to uploadpost_max_sizeis too small, so the full request is rejected even if the upload limit looks higher- The edited PHP config file is not the one used by the web server or PHP-FPM pool running WordPress
- Host-level overrides in
.user.ini, control panel settings, or pool config replace local changes - PHP was reconfigured but the active service was never reloaded, restarted, or switched
Step-by-Step Fix
- Confirm the current effective limits from WordPress Site Health, a PHP info page, or host tooling instead of trusting one config file blindly.
- Check
upload_max_filesize,post_max_size,memory_limit, and request timeout settings together because one lower limit can still block the upload. - Update the active PHP configuration in the correct layer for your host, which may be
php.ini,.user.ini, PHP-FPM pool config, Apache config, or a hosting control panel. - Make
post_max_sizelarger thanupload_max_filesizeso the whole HTTP request can be accepted cleanly. - Reload or restart the relevant PHP and web server services, or wait for host-managed config propagation if your platform applies changes asynchronously.
- Retest with a file slightly below the new limit to confirm the runtime is actually serving the updated values.
- If the error only affects plugin or theme uploads, also check reverse proxy body-size limits or WAF upload restrictions in front of WordPress.
- Use SFTP or host file manager temporarily only if you must bypass the web upload path while finishing a larger recovery action.
- Document the chosen limits and the config source of truth so future PHP upgrades do not silently revert them.