Skip to content
WordPress3 min read

WordPress "HTTP error" when uploading images

HTTP error.

Short answer

"HTTP error" means WordPress got an unexpected response from the server while uploading or processing the image. The most common cause is PHP running out of memory while creating thumbnails of a high-resolution photo, followed by the execution time limit or a security rule blocking the request. Resize the image, raise the memory limit, then check the error log.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. What the error means
  2. Common causes
  3. How to fix it
  4. Prevention
  5. On ArabyHost

The red message appears in the Media Library or the editor, during or right after the upload bar finishes. It’s a generic message that hides the real reason, so look in two places: your browser’s developer tools and the server’s error log.

What the error means

WordPress uploads the image through a request to wp-admin/async-upload.php, then generates several thumbnail sizes from it. If the server answers with an error code (403, 413 or 500), or the response is cut off, WordPress shows the short HTTP error. message. Recent versions may instead say that post-processing of the image failed and suggest uploading a smaller one.

Common causes

  • Out of memory while generating thumbnails: an image is decoded into roughly width × height × 4 bytes, so modern camera and phone photos need a lot of memory.
  • Execution time exceeded when the theme registers many thumbnail sizes.
  • File larger than allowed by upload_max_filesize or post_max_size, so the request is rejected with a 413.
  • A firewall rule blocking the request with a 403.
  • Expired session: you logged out in another tab, so the request was refused.
  • Unusual file name or format, such as special characters in the name, or HEIC photos the server’s image library can’t handle.

How to fix it

  1. Try a small image: if it works, the problem is dimensions, memory or size. Reload the page, log in again and retry.
  2. Get the real status code: open developer tools (F12), go to the Network tab, upload the image and check the async-upload.php request:
  3. Read the error log in cPanel under Metrics › Errors and look for Allowed memory size or Maximum execution time.
  4. Resize before uploading: 2560 pixels wide is plenty for websites, and it’s the size WordPress scales big images down to anyway. Compress to JPEG or WebP as in the image optimization guide.
  5. Raise the memory limit: wp-admin and image processing use the WP_MAX_MEMORY_LIMIT constant, so add it to wp-config.php:
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

Also raise memory_limit under Software › Select PHP Version › Options or in MultiPHP INI Editor, since a low PHP value can stop WordPress from raising its own. 6. Switch from Imagick to GD if the log shows Imagick errors. Create wp-content/mu-plugins/use-gd.php:

<?php
add_filter( 'wp_image_editors', function () {
    return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
} );
  1. Rename the file to Latin letters, digits and hyphens only, such as product-photo-1.jpg, and convert HEIC photos to JPEG.

Prevention

  • Set your camera or phone to a web-friendly resolution, or resize images before uploading.
  • Only register the thumbnail sizes you actually use.
  • Upload in small batches rather than dozens of photos at once.

On ArabyHost

You can set memory_limit and max_execution_time per site in cPanel and choose PHP 8.1, 8.2 or 8.3. Imunify360 protects sites from malicious requests; if you’re sure a 403 hit a legitimate upload, send support the time of the attempt and the page URL so they can check the rule. The Araby AI assistant reads the error log and tells you whether memory or time is the cause. See our WordPress hosting.

FAQ

Why do small images upload but large ones fail?

Memory use depends on pixel dimensions, not file size. A 6000 × 4000 photo can need around 96 MB of memory once decoded, before a single thumbnail is created.

Will another browser fix it?

Sometimes, if the cause is an expired session or a browser extension. If the same image fails in every browser, the problem is on the server and will show up in the error log.

Is the image saved despite the error?

The original may be saved in the Media Library without some thumbnails, because the error usually happens during processing after the upload. Delete it and upload again once fixed.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.