Ffile2fix
Sign in Get started

How to fix "HTTP error" when uploading images in WordPress

HTTP error.

The upload reached the server, but something failed while WordPress processed the image, so the browser only got a generic HTTP error. The most common reasons are running out of PHP memory or time while generating image sizes, or a problem with the Imagick library on the server.

Also appears as: photo.jpg: HTTP error. · The server cannot process the image. This can happen if the server is busy or does not have enough resources to complete the task. Uploading a smaller image may help. Suggested maximum size is 2560 pixels. · Post-processing of the image failed likely because the server is busy or does not have enough resources.

Common causes

  • PHP memory_limit too low to resize a large, high-resolution image
  • Imagick using too many threads or hitting resource limits on shared hosting
  • max_execution_time reached while creating many thumbnail sizes
  • Too many registered image sizes from the theme and plugins
  • Unusual image formats or color profiles (CMYK, very large PNGs)
  • A security rule (ModSecurity, WAF) blocking the async-upload.php request

How to fix it

  1. Try a smaller image. Resize the image to about 2560 pixels wide and save it as a standard RGB JPEG. If that uploads, the problem is resources or the image itself.
  2. Raise the memory limit. Add define('WP_MEMORY_LIMIT', '256M'); to wp-config.php and set memory_limit = 256M in php.ini. Image editing in wp-admin uses WP_MAX_MEMORY_LIMIT, which defaults to 256M.
  3. Limit Imagick threads. Add SetEnv MAGICK_THREAD_LIMIT 1 to .htaccess on Apache, or set it in the PHP-FPM pool with env[MAGICK_THREAD_LIMIT] = 1. This often fixes uploads on shared hosting.
  4. Switch to the GD editor. Add a small plugin or mu-plugin that puts WP_Image_Editor_GD first in the wp_image_editors filter. GD uses less memory for some images.
  5. Check logs for blocks. Look at the browser network tab for the async-upload.php response and check the server error log. A 403 or ModSecurity entry means a firewall rule is blocking uploads.

mu-plugin: prefer GD over Imagick for image processing

<?php
// wp-content/mu-plugins/prefer-gd.php
add_filter( 'wp_image_editors', function () {
    return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
} );

How to stop it happening again

  • Resize photos before uploading them
  • Remove unused image sizes registered by themes and plugins
  • Keep memory_limit at 256M or more on media-heavy sites
  • Use RGB JPEG or WebP for web images

Frequently asked questions

Why does WordPress not show the real error?

The upload is processed by an AJAX request. When PHP fails, WordPress only receives an error status, so it shows a generic message. The real cause is in the server error log.

Did the image upload anyway?

Sometimes the original file is saved but thumbnails are missing. Check the Media Library and regenerate thumbnails after fixing the cause.

Is it a browser problem?

Rarely. Trying another browser or clearing cache can help if a login session expired, but most HTTP errors come from the server.