HTTP Error when uploading images in WordPress – no thumbnail

Did you ever see HTTP Error when uploading an image in wordpress? Most of the times the images are uploaded but no thumbnail is created. And sometimes the images are not even uploaded. We are going to discuss about this right now!

There could be several issues that cause this error. First of all, we can assume that you don’t have enough memory for the script to be executed. So, try adding something like the following in your wp-config.php file:
[php]
define(‘WP_MEMORY_LIMIT’, ’64MB’);
[/php]

In stead of 64MB you may need more, though you can’t exceed the limit that your host allows you to use :)

You may also read:  PHP: Find maximum odd number of sequence in an array

If the solution doesn’t work, then open the .htaccess file from root of wordpress installation and add the following line:
[html]
AddType x-mapp-php5 .php
[/html]

Third issue could be mod_security is enabled in your server. To overwrite the default, create a .htaccess file in your wp-admin folder and paste the following code in there:
[html]

SecFilterEngine Off
SecFilterScanPOST Off

[/html]

Another main issue I suppose that your script is using ImageMagick library, but you need to use GD library to resolve the HTTP error. You need to force wordpress to use GD library in this case. To force you can use the following code:
[php]
add_filter( ‘wp_image_editors’, ‘force_to_use_GD’ );
function force_to_use_GD($array) {
return array( ‘WP_Image_Editor_GD’, ‘WP_Image_Editor_Imagick’ );
}
[/php]

You may also read:  Change the order of posts in an archive page

I hope one of the above should fix your issue. There are more possible options out there though, but these are the common ones :)

You may also like...

Leave a Reply

%d bloggers like this: