WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using WordPress 3.4.1 on Ubuntu 12.04 using Apache and PHP 5.3.X

When I login to the dashboard and add a new post. Then try uploading an image to set as a featured image, I get a red box with a message "HTTP Error".

I have read about people saying to not use the flash uploader and just use the browser uploader, but when I try that, I just get a 500 Internal Server Error.

I have tried adding AddType x-mapp-php5 .php at the top of my .htaccess file, with no luck in change.

Disabling ALL plugins had no effect. I tried a fresh install. No luck.

WordPress 3.4.1 Media Upload HTTP Error

share|improve this question
up vote 8 down vote accepted

After troubleshooting with @Wyck in chat, we have narrowed to the underlying issue.

The issue was related to my server configuration not having the proper amount of memory allocated to Apache/PHP.

If anyone has this same problem, please try verifying that you have enough (64MB+) server memory allocated to Apache/PHP in your server configuration settings. You can also add this to your wp-config.php file: define('WP_MEMORY_LIMIT', '64MB');

If the above solution does not work, read this article (Image/Media Uploader problems?) for further trouble shooting.

try adding one by one or all of the following .htaccess tweaks to the .htaccess file in the root directory of your WordPress installation.

Seriously, try one of each of the solutions below so you know which one did the trick. Don't just paste them all in your .htaccess file immediately.

Try this line:

AddType x-mapp-php5 .php

mod_security might be causing problems. Disable it to see if that is the problem. To do this, make an .htaccess file in your wp-admin directory. Add this to it:

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off

If you're using Access Control based on Authentication on your Webserver (often known as htpasswd, Basic Authentiaction, password protected directory or similar), WordPress is not able to handle it for Flash Uploader, Cron and XMLRPC. Related files need to be excluded to work. Keep in mind that this might break your security considerations.

# Exclude the file upload and WP CRON scripts from authentication
<FilesMatch "(async-upload\.php|wp-cron\.php|xmlrpc\.php)$">
    Satisfy Any
    Order allow,deny
    Allow from all
    Deny from none

One final note: some have said that if using a lesser version of PHP 5.3.X you can try disabling PHP Safe Mode.

If you are running WordPress multi-site and are receiving HTTP errors or Internal Server errors, related to image uploading, please read Uploading Images to Multi-Site Causes Failure to HTTP Error for other possible trouble shooting ideas and solutions.

share|improve this answer
Whats wrong with your server configuration? Not enough ram or ??? Can you explain please? Just wondering .... – Damien Jul 26 '12 at 22:02
@Damien The issue was related to my server configuration not having the proper amount of memory (AKA - RAM) allocated to Apache/PHP. – Michael Ecklund Jul 26 '12 at 22:13
ok ... good to know ... did you read that WP tries to allocate up to 256MB of ram so this define('WP_MEMORY_LIMIT', '64MB');should be larger if possible. – Damien Jul 26 '12 at 22:35
If you're using WP 4.1.1, the AddType x-mapp-php5 .php is no longer a viable solution as it forces the page to simply print the PHP code as plain text – cameronjonesweb Mar 27 '15 at 6:02
Or add this to your sites config file if you are using nginx: client_max_body_size 128m; – Flatron Jun 28 '15 at 16:00

I put the following code into my functions.php file. It works!

add_filter( 'wp_image_editors', 'change_graphic_lib' );

function change_graphic_lib($array) {
  return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
share|improve this answer
Please try to add some explanation when you are sharing a code block, like, how the code can help and how the code works etc. – Mayeenul Islam Apr 30 '14 at 6:15
Don't just dump code as an answer and sya that it works. Please explain to why your code works or might work and point to where the OP went wrong in his code – Pieter Goosen Apr 30 '14 at 6:34
@MayeenulIslam I third that. What does returning that array do? Change the order in which those libraries will be used? – codecowboy Dec 12 '14 at 17:00

I ran into the same error, when trying to upload media in wordpress. In Chrome, it shows up as a http: error; in Firefox, the error looks quite different. The web is full stories of people who have spent days to chase the bug (so have I :-( ). Solutions abound, but nobody explains why, at least not in a way that is consistent with the symptoms.

My tuppence worthy contribution: I noticed that the problem correlates with a segmentation fault signalled in the log file of apache2. That disturbs me, because it is difficult to diagnose.

Rebooting the entire server took away all symptoms and all of a sudden I could upload media again in Wordpress. Frustratingly, I have no clue as to why this occurs. The reboot effectively stopped me from any further research, and I will now have to wait (weeks? months?) for the problem to reappear. I hope this will help others in their quest for the cause of this problem. My wife is happy, though, because I can no longer spend nights chasing this problem...

share|improve this answer

I have resolved this issue by changing my owner from root to apache as below.

chown -R apache:apache /var/www/html/mydomain

and then i have change the permission of the wp-content/uploads/ 775

after that i have tried to upload image in the media i was successful to upload the image.

share|improve this answer

protected by Community Aug 22 '14 at 14:41

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.