WordPress image upload error & media http upload error

HTTP error in WordPress is a common thing. Most of the beginners face this error while migrating their website from localhost to live server. Read this post to fix HTTP error and other WordPress media/image upload errors.

Why WordPress HTTP image error/media error occurs

There are few reasons to create these errors. These errors are occurs whenever the user try to upload the image in media or it also occurs while uploading some feature image to the page/blog post.

Wordpress image upload error & media http upload error

Image error also occurs while uploading your woocommerce featured image. The solution is similar to all those image uploading errors. So don’t confuse yourself with these errors and also I have an easy solution for it.

The solution to wp image http error/media image error

  • Method 1: Edit the wp-config.php file in /wp-content/ folder add this line at the bottom of the wp-config file.
define( 'WP_MEMORY_LIMIT', '256M' ); 
  • Method 2: Open function.php file in public_html/wp-includes/ folder and the below lines
 
function wpb_image_editor_default_to_gd( $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', 'wpb_image_editor_default_to_gd' );


  • Method 3: By editing .htaccess file. open the .htacess file and add the below line of code at end.
SetEnv MAGICK_THREAD_LIMIT 1

First try these 3 methods to fix the http/image error issue. if still the problem persists means follow the below listed method.

Open FTP software like FileZilla and connect your FTP account with user name and password.

open the pubic folder and open the wp-content folder

Right click on the wp-content folder and choose the File Permission options

Now go to the Numeric value field and add 744 and tick the Recurse into subdirectories options and choose the Apply to directories only

set file permission to 744

Now the image upload problem will solved. if still error comes means replace 744 to 755 like shown in the below image

set file permission to 755
Best method to Fix wordpress image/media http error by editing wp-config file, functions.php, .htacess file. Steps are described with screenshots.

The Image http error problem is now fixed.

Note: In some rare cases the error still persists. This may occur due to server hosting issues or this may occur when user install the wp total cache plugin on their site. So its need to disable the wp total cache plugin.