How to Fix the HTTP Image Upload Error in Media Library

wordpress http image upload error media library

If you are unable to upload images to posts or pages via Media Library, below are quick and easy fixes for HTTP upload error.

Image Editor Library

In the most cases the problem can be solved by changing the default WordPress Image editor from Imagick  to GD Library.  You can do this by editing your functions.php file.  Open functions.php that is located in wp-content/themes/your-theme/functions.php and add this code to the bottom of the file and save it.

function wpimgupload( $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’, ‘wpimgupload’ );

WordPress Memory Limit

After adding the code, try to upload the image to the media library.  If you’re still getting the HTTP error, open up your wp-config.php file that is located in the root directory of your site and increase the PHP memory limit by adding this code:

define( ‘WP_MEMORY_LIMIT’, ‘256M’ );

If both solutions are not able to fix the error, open the .htaccess file that is also located in the root directory and add the following code:

SetEnv MAGICK_THREAD_LIMIT 1

If any of these fixes are not working on your end, get in touch with me and I’ll check what’s the issue.