HTTP Error

HTTP image upload error is a common error in WordPress while uploading media in WordPress. You can face the error while you are trying to upload an image or other files using a built-in media uploader. Moreover, if you are getting this error, then this article will fix the issue.

What Causes HTTP Image Upload Error

There is no way to figure out the exact reason for causing HTTP image upload error in WordPress. Because the error doesn’t show any clue for causing the error. Even WordPress can’t figure out the exact reason or provide any guidance on it. 

HTTP Image upload error

So, to fix the HTTP image upload error in WordPress, you have to try different solutions. In this article, I have tried all possible solutions to fix the error. I hope, these will satisfy your need. 

1. Check HTTP Error Type

First of all, you have to ensure that the error is not temporary. Because sometimes it may be caused by unusual traffic and low server resources that are automatically fixed. So, you have to wait a few minutes and try again uploading images or files. 

Again, if you face the problem again, I recommend trying with another image or file. If the image or file is uploaded successfully, then you have to change your previous image or file size or sometimes type. 

In this case, you can reduce the image or file size a bit and for image, I recommend changing the type also like the image type is png, then convert it to jpg. 

Still have the problem, then move to the next solution and try it. 

Looking for Developer

2. Increase WordPress Memory Limit

The most common reason for causing the HTTP image upload error is the lack of memory available for WordPress to use. So, you need to increase the WordPress memory limit.

You can simply increase the WordPress memory limit. To do this, you have to go to your wp-config.php file and paste the following codes. Consequently, it will increase the memory limit and make it 256MB that is enough to fix any memory limit issues.

<?php 
define( 'WP_MEMORY_LIMIT', '256M' );

3. Change Image Editor Library

WordPress uses two PHP modules called GD Library and Imagick to handle images. WordPress runs with one of them that is available. However, sometimes the Imagick may cause an HTTP image upload error. So, to fix the error, you can make the GD library your default image editor. To do this, you just need to add the following codes to your theme’s functions.php file- 

<?php 
function webakstop_default_img_upload( $editors ) {
$gd_editor = 'WP_Image_Editor_GD';
$editors = array_diff( $editors, array( $gd_editor ) );
array_unshift( $editors, $gd_editor );
return $editors;
}
add_filter( 'wp_image_editors', 'webakstop_default_img_upload' );

If these codes fix the issue for your site, then it’s great. Otherwise, simply remove these. 

4. Edit .htaccess File

Many shared hosting providers limit the ability of Imagick Module to use multiple threads for faster image processing. So, you can easily fix the issue by adding the following code in your .htaccess file

SetEnv MAGICK_THREAD_LIMIT 1

Finally, I hope this article will satisfy your need. If you need any more help, please feel free to contact me

Leave a Reply