Home/Blog/How to Fix “Uploaded File Exceeds upload_max_filesize” Error

How to Fix “Uploaded File Exceeds upload_max_filesize” Error

Uploaded file exceeds upload_max_filesize error fix

Trying to upload a video, a premium theme, or a large image, only to be told “The uploaded file exceeds the upload_max_filesize directive in php.ini”? This is a server limit, not a WordPress bug โ€” and this uploaded file exceeds upload_max_filesize fix guide shows you how to raise it. You’ll learn which settings control upload size, five ways to increase them, and what to do when your changes don’t seem to stick.

What Causes “Uploaded File Exceeds upload_max_filesize”

PHP caps how large a single uploaded file can be through the upload_max_filesize directive, which many hosts leave at a tiny 2M default. WordPress can’t override this from its own settings โ€” it only displays the limit. Your file is simply bigger than the server allows. The key settings and gotchas:

  • upload_max_filesize too small: the direct cause โ€” your file exceeds this single-file cap (often 2Mโ€“8M on shared hosting).
  • post_max_size not raised alongside: this caps the total data in one request and must be equal to or larger than upload_max_filesize. Raising only one of them is the most common reason fixes “don’t work”.
  • Low max_execution_time / max_input_time: large uploads take longer; if PHP times out mid-upload, you get a failure even with generous size limits.
  • Host overrides your changes: some hosts ignore per-site php.ini edits, load a different php.ini than the one you edited, or enforce master limits โ€” so your edits appear to do nothing.
  • .htaccess php_value on PHP-FPM/CGI: adding php_value lines to .htaccess on a server running PHP as CGI/FPM doesn’t work and can cause a 500 error instead.
  • Multiple conflicting php.ini files: values can be defined in several places (php.ini, .user.ini, .htaccess, hosting panel) and one overrides the other. Check the real active values in Tools โ†’ Site Health โ†’ Info โ†’ Server. More PHP guides live on the KamiWeb blog.

How to Fix “Uploaded File Exceeds upload_max_filesize”

First check your current limit: go to Media โ†’ Add New and read the “Maximum upload file size” note at the bottom. Then pick the method your host supports โ€” and always raise post_max_size to match. Our free web tools can help you verify your site’s configuration afterward.

Raising PHP file size limit sliders concept

  1. Use your hosting control panel (easiest and most reliable). In cPanel, open MultiPHP INI Editor or Select PHP Version โ†’ Options, choose your domain, and set upload_max_filesize = 128M and post_max_size = 128M (plus max_execution_time = 300). Save and confirm the new values in Site Health. Panel changes apply at the right level and won’t be overridden.
  2. Edit php.ini or .user.ini. In your site root (enable “show hidden files”), create or edit php.ini โ€” or .user.ini on hosts like GoDaddy โ€” adding upload_max_filesize = 128M and post_max_size = 128M on separate lines. Some servers need a few minutes or a PHP restart for changes to apply.
  3. Add php_value lines to .htaccess (Apache/LiteSpeed only). At the bottom of the .htaccess file in public_html, add: php_value upload_max_filesize 128M, php_value post_max_size 128M, php_value max_execution_time 300. Skip this method if your host runs PHP as CGI/FPM โ€” it will break the site instead of helping.
  4. Use @ini_set in wp-config.php. Just above the /* That's all, stop editing! */ line, add @ini_set('upload_max_filesize', '128M'); and @ini_set('post_max_size', '128M');. This works on hosts that permit runtime overrides, though it’s the least powerful of the methods.
  5. Contact your host. If nothing changes the limit, your host enforces a hard cap (some shared plans max out at 128M regardless of settings). Ask support to raise the limit for your account โ€” it’s a routine request they usually complete in minutes. Browse KamiWeb’s plugin resources for media-optimization tools that keep files small.

Conclusion

The uploaded file exceeds upload_max_filesize fix is straightforward: raise upload_max_filesize and post_max_size together (to at least 128M), verify the real values in Site Health, and avoid .htaccess php_value on PHP-FPM servers. When your host locks the limit, a quick support ticket is the fastest route. And as a habit, compress images and videos before uploading โ€” most “too large” files don’t need to be that big in the first place. More WordPress solutions at KamiWeb.