How to Fix the HTTP Image Upload Error in WordPress

Image of the HTTP error message

When working with images in WordPress, it is possible that you get an error when uploading to your site. This error is a rather vague HTTP error. This can leave many people puzzled as to how to fix this. Here we will show you one method to correct the error in your WordPress site.

Correcting the HTTP Upload Error

  1. Log into your cPanel dashboard.
  2. Using the file manager, navigate to your WordPress site’s root directory.
  3. Locate and open the .htaccess file for editing.
  4. Add the following line of code at the top of the file:
    SetEnv MAGICK_THREAD_LIMIT 1
  5. Save the changes to the .htaccess file.

Now you should be able to upload the image in your WordPress site without issue. If your problems persist, we recommend following our WordPress Troubleshooting guide.

Thoughts on “How to Fix the HTTP Image Upload Error in WordPress

  • For me it was a $%*ing apostrophe in the file name, didn’t even notice it….

    Thanks for the tip!! 😀

    Problem solved

  • For me i didnt have to edit my htaccess file. after i removed the apostrophe from the file name, it uploaded with no problem. so I guuss its probably some plugin or the core that is not accepting certain characters. Anyways im glad you guys have a solution.

  • Perfect! Thank you!

    any chance you could explain what causes the errror? I tried PSD 6 and PSD CC both gave the error before you fixed it.

    • As per this post in the WordPress.org support community, there can be a number of reasons for the error. It may vary based on what you have installed or the configuration of your site.

  • Same here. I got an HTTP error on PNG images, but after I changed them all to JPG, they uploaded in record time.

  • For you that worry that you have to go do this to retrospectively to sites you already my have, here you can use this:

    find . -type f -name “.htaccess” -exec sh -c ‘echo SetEnv MAGICK_THREAD_LIMIT 1 >> “$1″‘ — {} \;

  • The recommended change didn’t work.

    I reduced the filesize to something quite small, that didn’t work.

    I changed the format to .jpg form .png worked immediately.

    • Make sure that you have cleared your browser cache and re-logged into the administrator dashboard. Also, make sure that the command is at the top of the .htaccess file and that you’re in the appropriate .htaccess file (there can be more than one). If you continue to have the error, then you may need to consult with a developer or contact our live support team.

  • Disabling the plugin Askimet (my Hello Dolly plugin was disabled long before this problem arose) fixed the issue for me. Thank you so much!

  • Just a quick thanks for this fix. It absolutely worked a dream. I’ve encountered this problem on a few sites lately and will try this every time. (BTW it was another host’s cpanel so it’s not just for Inmotion hosted sites).

     

    Cheers 🙂

  • I had been having the same issue and after some troubleshooting, i found wordpress default plugin Akismet and Hello Dolly was responsible. It may not be the same but this might be it in may cases like mine… Hope it helps

  • I had the same problem but managed to resolve it using the following method. All of my images had been optimised using Photoshop and saving for Web & Devices. These .jpg images failed to upload. I opened up each image and just did a “save as” which uncompressed the files by quite a margin (150 KB instead of 40-50 KB). They uploaded successfully and at the same time were shrunk considerably back to circa 40-50 KB so all was well. My uneducated guess is the upload fails as the images were already compressed to the maximum. Not had any problems since I discovered that uploading also compressed files. Hope this helps.

  • Tried the edit but to no avail. Am I correct in assuming the fix is peculiar to InMotion Hosting?

  • So I was having this problem as well, and that got me here.

    I had a plugin “WP Smush” installed. Was the first I deactivated, and viola! All images are uploading…. I think you should add “all image compressing/editing plugins should be deactivated first.

    Regards

    • This fix also applies to a base WordPress installation with no image manipulation plugins. It relates to a core WordPress image function.

    • Dipesh, thank you very much for sharing! Please keep in mind as well that there may be other causes to this issue beyond the ones discussed in the article here, as well as in your link.

  • Hi. Thanks for the fix. 

    But I have to add this code to my .htaccess file everyday….

    The next day I get the same error. And I have to add this code again…

    What do I have to do to fix this error permanently…

    Thanks

    • Hello Fano,

      Sorry for the problem with your .htaccess file. Either your file is being hacked every day or you have a security plugin that is taking the change that you apply out. If you suspect a hack, then make sure that you have replaced your cPanel password and then check to see that you change is staying in place after you have applied it. Make sure to check your security options too, as they may be keeping a specific version of the file in place.

      If you have any further questions or comments, please let us know.

      Regards,
      Arnel C.

  • I’ve tried it all man. Nothing has worked. I still have a few lessor important sites on WordPress, but I moved my most important site over to Squarespace. Could not be happier. I was a loyal user for years but WordPress has permanently lost me at this point, at least for any site of importance. A seemingly un-fixable error is not ok. 

  • I eventually found a fix, by changing the PHP version used for sites, from 5.5 to 5.6.

    Our hosting company default version of PHP is 5.5.x. and they say, if you want to use PHP 5.6.x,  or 7.0.x explicitly, just add one of the following commands to your .htaccess file.

    PHP 5.5 (Default) 
    AddHandler application/x-httpd-php55 .php

    PHP 5.6
    AddHandler application/x-httpd-php56 .php

    PHP 7.0
    AddHandler application/x-httpd-php70 .php

  • Hey there guys, I know there’s already a solution to this problem, but for some reason, I’m getting this issue in WordPress 4.7.1 and your fix is giving me an Internal server Error

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator at no-reply@x10hosting.com to inform them of the time this error occurred, and the actions you performed just before this error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

    • This is a pretty general error. You will want to contact your hosting support so they can look at your logs for the specific error message and correct it.

    • Neil, I’m sorry to hear that this method was unable to resolve your issue. Unfortunately, as the article mentions this is a vague HTTP error, and the proposed solution listed here is only one possible fix. You may wish to contact your web host’s Support if possible, and ask them for account-specific assistance.

  • Unfortunately I spoke too soon. Tried this fix on a second WordPress site of mine (that’s more important) and I still get the HTTP Error. However, so far it happens less than it used to, so not sure what’s going on.

    Sigh. I knew it was too good to be true. Back to searching. Maybe I just need to move on from WordPress. They have to know this is a bug by now, it’s been years! Yet there is still no permanent fix.

  • This fix just saved my life! Well, not quite, but almost. I have been dealing with this ridiculous error for the better part of a year. I basically gave myself an ultimatum to either fix this error soon, or I would have to abandon the entire WordPress platform altogether. It has absolutely killed my productivity when composing new posts.

    I have tried every kind of fix up until I found your post on wordpress.org, which then led me back here. Here’s the WP post: https://wordpress.org/support/topic/http-error-on-media-upload-7/page/2/

    And when I say I tried everything, I mean EVERYTHING! I literally thought I had tried every fix out there by now. By a miracle I found this. So far so good! I was able to upload seven pictures at once with zero errors. It’s probably been more than a year since that last happened. Thank you so much!

    And for others that have little experience with this, I literally put the code from step 4 as the very first line in the file. Saved it, and boom. Fixed. FINALLY! Here’s to hoping it’s a permanent solution!

  • Inmotion should really include it in their instructions they send after a VPS upgrade.

    I had the same problem after I upgraded to VPS but I had to wade through a lot of other answers on Google before I found this one.

    This worked for me too.

  • I too upgraded from a shared hosting plan to VPS, and ran into the same issue. Adding this line to the top of my .htaccess file fixed it right away. I have about 6 sites, but so far only one has been affected by thius issue. 

  • Hi Scott,

    This post helps me solve the problem after upgrade plan from Shared host to VPS.

    Just want to inform to everyone that have the same case should try this one.

    Thanks,

    Weerayut Teja

    • Scott – Where do I edit the .htaccess template in my VPS servers?

      Because right now I have to add the SetEnv MAGICK_THREAD_LIMIT 1 to every .htaccess file after installing WordPress for new websites.

  • The above mentioned is already in the htacces file now. But I still have the problem? Any suggestions are welcome.

Leave a Reply to Meh Cancel reply