WordPress

Fix "HTTP error" and failed image uploads in WordPress

Fix WordPress media uploads that fail with "HTTP error", "exceeds the maximum upload size" or "unable to create directory": limits, permissions, image libraries and plugins.

BeginnercPanel hosting3 min read

Uploading an image to the WordPress media library should take seconds. When it fails, WordPress often shows only a vague "HTTP error", or a more specific message about size or folders. The cause is almost always one of five things: a PHP limit, file permissions, the image processing library, a plugin or the image itself.

Before you start

  • Note the exact error message and the size and type of the file.
  • Try uploading a small JPEG (under 500 KB). If that works, the problem is specific to large or unusual files.
  • Try a different browser or a private window to rule out browser extensions.

Match the error to the cause

MessageLikely cause
"The uploaded file exceeds the upload_max_filesize directive"PHP upload limit too low
"HTTP error" on large imagesMemory or time limit hit while creating thumbnails
"Unable to create directory wp-content/uploads/…"Permissions, ownership or full disk
"Sorry, you are not allowed to upload this file type"File type blocked by WordPress
"Post-processing of the image failed"Image too large in pixels or missing image library

Raise the PHP limits

  1. Open cPanel → Software → Select PHP Version → Options (or MultiPHP INI Editor).
  2. Set upload_max_filesize and post_max_size to at least 64M.
  3. Set memory_limit to 256M and max_execution_time to 120.
  4. Check Media → Add New: the "Maximum upload file size" line should show the new value.

Check folders and disk space

  • In cPanel → Files → File Manager make sure wp-content/uploads exists and is 755, with year and month subfolders also 755.
  • Check cPanel → General Information → Disk Usage. A full quota stops all uploads.
  • In Settings → Media, untick or tick Organize my uploads into month- and year-based folders consistently; an old custom upload path in the database can point to a folder that no longer exists.

Check the image library

WordPress uses the PHP extensions imagick or gd to create thumbnails. In Select PHP Version → Extensions, make sure at least one is enabled. If uploads fail only on large photos, Imagick may hit its resource limits; enabling gd as well, or temporarily switching off imagick, often helps.

Resize the image

A 6000 × 4000 pixel photo needs a lot of memory to process even if the file is small. Resize images to around 2000–2500 px wide before uploading. WordPress scales very large images down anyway, but it has to load the full image first.

Rule out plugins

Image optimisation, security and CDN offload plugins hook into uploads. Deactivate them temporarily and try again. If the upload works, reactivate them one by one to find the culprit, and check its settings or update it.

Allow additional file types

WordPress blocks some types such as SVG for security. Use a plugin that sanitises SVG files rather than allowing them globally. Avoid enabling ALLOW_UNFILTERED_UPLOADS on live sites; it lets administrators upload any file type, including scripts.

Upload very large files another way

For videos or large PDFs, upload through File Manager or FTP into wp-content/uploads and register them with a plugin such as Add From Server, or better, host videos on a streaming service and embed them.

Troubleshooting

  • Still "HTTP error" with everything fixed: check error_log in the site folder and cPanel → Metrics → Errors for the real PHP error.
  • Uploads work but thumbnails are missing: regenerate them with the Regenerate Thumbnails plugin after fixing the image library.
  • Error only with Imunify360 notices: a file was flagged as suspicious; check cPanel → Security → Imunify360.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.