Troubleshooting guide · wordpress · Published 2026-08-15 · 4 min read

WordPress media uploads failing

Why WordPress media uploads fail with an HTTP error, and the ordered fixes for uploads permissions, PHP upload_max_filesize, execution time and disk space.

Symptoms

You drag an image into the media library and it fails. Depending on the browser the failure shows as "HTTP error" with no detail, a blank upload box, a "Sorry, uploaded file exceeds the maximum upload size" line, or the file appears small and then vanishes. PHP intentionally hides the real reason from the browser, so the message is a hint, not the diagnosis. The same file can upload to a different site or over a different path and succeed, which shrinks the cause list to your server settings.

Common causes

The fix in order

  1. Prove the simplest request works first. Upload a tiny file (a 1 x 1 PNG). If that succeeds and a large one fails, it is a size limit or time; if even the tiny file fails, it is a server-side block or permission. This one test splits the diagnosis in half.
  2. Check the uploads directory permissions.
ls -ld wp-content wp-content/uploads
drwxrwxr-x  www-data www-data  ...

The directory must be owned by and writable to the web server user. The web user differs from your shell user on many hosts; if ls shows the directory owned by www-data and your shell writes as root, that is the mismatch. Set the user and mode via the host tool or:

chown -R www-data:www-data wp-content/uploads
chmod -R 755 wp-content/uploads

Keep uploads recursive-writable for the web user, but never world-writable.

  1. Raise the PHP upload limits. The relevant php.ini pair:
upload_max_filesize = 16M
post_max_size = 20M

Site Health and the host panel show the current values. After editing, restart PHP-FPM or Apache, because the value is read at startup. Then the media library shows the new cap.

  1. Give image editing time and memory. For big panoramas or batch image operations, images get processed server-side after save. If a 12 MB photo consistently fails while a 2 MB one works, raise max_execution_time to 120 and the memory limit per the memory-limit path, or generate derivatives in a queue.
  2. Free disk space. A full volume behaves as a permission or 500 kind of error. Confirm with df -h, then empty log files, old backups, and wp-content/cache.
  3. Test around plugins and WAF. Temporarily deactivate the security plugin and the image-optimisation plugin (if stacking causes double-processing). Many such plugins queue a WebP or compression step that runs after the upload and turns a fine request into a 500. If the area is behind a proxy, check that the host WAF is not dropping POST bodies above a size.
  4. Try the alternate upload path. On a shared host where uploads sits on a flaky mount, moving the upload folder to object storage via the upload_path and upload_url_path settings, or a plugin that delegates to a CDN, sidesteps the filesystem entirely. That is a deeper redesign, only worth it when the disk itself is the recurring offender.

Prevention

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services