# WordPress Media: “HTTP error.” when uploading images

**Code:** `HTTP error (media upload)` · **Category:** WordPress · **Seen on:** WordPress

The upload request failed on the server — memory or timeout during image processing, upload size limits, ModSecurity, or Imagick issues.

## Meaning

The generic “HTTP error.” hides a server response like 500/413/403. Large images trigger memory/time limits while generating sizes; Imagick with limited threads/resources can crash.

## Common causes

- PHP memory/time limit while resizing large images
- Upload size limits (upload_max_filesize, Nginx client_max_body_size)
- ModSecurity/WAF blocking the upload
- Imagick resource issues

## Quick fix

1. Check the browser network tab and server logs for the real status
2. Raise memory_limit/max_execution_time and size limits
3. Try switching the image editor to GD (filter wp_image_editors)

## Detailed fix by platform

### WordPress

1. `add_filter('wp_image_editors', fn() => ['WP_Image_Editor_GD', 'WP_Image_Editor_Imagick']);`

### PHP

1. 

```php
; php.ini
memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 120
```


## How to diagnose

1. **Status** — Network tab response code
2. **Logs** — PHP/Nginx error log
3. **Size** — Image dimensions/megapixels

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/wordpress/http-error-uploading-images)
