Fix HTTP Error When Uploading Images to WordPress in 2020

Posted by
HTTP Error When uploading Images to WordPress

If you are reading this article then I am sure you may face some HTTP Error When Uploading Images to WordPress. This error actually occurs, when you upload an image or any other file into WordPress via media uploader and suddenly get a message with “HTTP error !” At that moment you may think about what happens, while you do nothing or change any function at all, then you might waste so much time trying to fix the problem and have not found any solution. Well, this (“HTTP Error When uploading images to WordPress) issue happens with me once and I follow some steps and get rid of it once for all. I will show you 15 methods to fix the problem.

First, we will discuss and let you know why this problem appears. If we knew about the problem so well then it would be easier for us to solve the dispute.

What is theHTTP error” that indicates us?

Http error shows us that something went wrong in WordPress. It also indicates that we are going through some images or file uploading problems that should be fixed.

Why Occurs HTTP Error When Uploading Images to WordPress?

There are two main reasons behind it and they are :

  • Client error
  • WordPress error

Client Error:

When there is a problem on the user side then it appears Http error while you upload images to WordPress. I think this is for the

  • Login Failures
  • Local cache
  • Error in the file name
  • Connectivity problem caused by the local computer where the WordPress dashboard is being accessed from.

WordPress Error:

When some trouble was created in the media uploading process at that time WordPress couldn’t figure it out and thus generated this error. And there is also a problem that WordPress doesn’t let you know the proper reason behind this error. There is a possibility that the

  • Server issue
  • Memory limit
  • Plugin issue
  • Theme support

Etc. are the reason for this. So, you have to try to fix the problem at any cost. Neither you can’t able to access your file or any other thing into WordPress.

For you, there will be 15  ways to fix the problem, you may try any of it which is suitable for you.

How to fix HTTP Error Uploading Images or Files to WordPress?

  1. Deactivate Plugins
  2. Increase WordPress Memory Limit
  3. Change upload Folder Permission
  4. Check the Http Error is not temporary
  5. Analyze your PHP Version
  6. Edit .htaccess
  7. Change or Edit Your Themes
  8. Change your Default Image Editor
  9. Rename File
  10. Resize File
  11. Switch Browser
  12. Clear Cache
  13. Media Library Path
  14. Change Image Extension
  15. Consult with your WordPress Host

Tips 1: Deactivate Plugins

WordPress Deactive Plugin

Some of the image optimization plugins don’t support image files. Including some security plugins like Word Fence, they also create problems to upload png or jpeg files.

I realized that WordPress isn’t as simple as it’s made out to be there’s actually great amount of different parts to make WordPress work in general on installation so with that being said every time you download a plugin if the plugin isn’t compatible with your version or an updated version of WordPress or the plugin itself isn’t updated then there’s some conflicting stuff going on there, so that’s sometimes usually causing the problems with the image error and whether you go in your library and all the images have an error on them or you click on the image it’s just blank you can’t see it.

This may be the reason for the “HTTP Error when uploading images to WordPress”. If you installed a plugin into your dashboard recently and face the same problem then it will be better for you to deactivate it. Disable it temporarily and try uploading the image once more.

If the HTTP error is gone, you may try looking for another alternative image optimizer plugin or you can get in touch with the plugin developers to deal with the error further.

Whether disabling all plugins doesn’t come with the solution then move on to more solutions presented below.

Tips 2: Increase WordPress Memory Limit

Another cause behind HTTP Error When uploading images to WordPress happens for a lack of memory. In order to fix it,

You must increase your memory limit of WordPress by using the PHP server.
First, go to the PHP server then move to public_html and you will find the “wp-config.php” file.

wp-config php file

In the below, you can see an image was given you just simply copy the following line and put it into the “wp-config.php” file.

define ('WP_MEMORY_LIMIT', '256M');

This code will increase your PHP memory limit to 256 MB. Before putting this code into a PHP file you must check and confirm what the maximum memory limit is on your server.

Tips 3: Change Upload Folder Permission

Before you go any other solution you must check your folder permission. If you check it and figure out the permission of the folder is changed then simply fix it and you’re done with the problem.

Wrong folder permission is also another matter of an occurrence “HTTP error when uploading images to WordPress”. If there is any malware-infected in your WordPress and it changes your file permissions approximately when you upload a file into the media it won’t show up and it becomes blank only.

Files uploaded via the media library are stored in a folder named “Upload”. In my previous article, I showed that where can you find this stored folder. Go to the link below and know how to go to the upload file using the FTP Client.

How to Install a Theme into WordPress

Upload file using the FTP Client

Using FTP client you can see your folder permissions or you can also get in touch with your WordPress host for help or support.

File Permission

In order to the WordPress Codex, all directories should be 755. Which I already showed you in the images. If your folder permission is not correct then make sure you make it correctly. Go the upload file then right-click on your mouse and you will see “File Permission”

WordPress File Permission Option

Access the File Permissions and you will be able to see “Change file attributes” then go to the “Numeric Value” and make sure you change the value into 755.

WordPress Change File Attributes

For the subdirectories, you also want to make sure you click on the apply to directories only and click ok and you will be done. Go to your media panel and upload a file or images for checking if this issue even exists or not. If your problem is not solved, then go to the other optional tips.

Tips 4: Check the Http Error is not Temporary

Make sure about the HTTP Error when uploading images to WordPress is not temporary. Often a temporary problem in the server may cause this problem or it’s because of low server resources or unusual traffic, which are automatically fixed by the WordPress hosting servers all you have to do just refresh the site.

 

Then try your original image file spinner

If that doesn’t work, then try another image file in spite of the main one. If the other file successfully, then try your original image file.
When all these steps go wrong that means the error is not caused by a temporary.

Tips 5: Analyze your PHP Version

For running WordPress smoothly, it needs to be a higher PHP version as 5.2.4 or above. The lower version of PHP may perform slowly and be stuck with the HTTP Error while uploading images to WordPress. A few hosting servers use some older versions of PHP so that when you just upload a file it comes with an error. Check your PHP version if that is lower make sure you contact your hosting servers to upgrade your PHP version or switch to another host.

PHP Image

Tips 6: Edit .htaccess File

What is the .htaccess file?

The .htaccess file is a great effective website file that controls the high-level configuration of your website. The .htaccess file allows you to change your website’s configuration without having to edit server configuration files.

Uses of .htaccess file:

The most common uses for the .htaccess file are:

  • Prevent hotlinking
  • Password protect specific directories on your server
  • Load custom error pages,
  • Control request function

Using .htaccess files is a powerful tool for developing and restructuring your website process, but it can be tricky. To be sure that you are familiar with making changes to your server before editing .htaccess files.

Why show “HTTP Error When Uploading images to WordPress”?

Many hosting providers limit Image magick to use multiple threads for faster image uploading which causes the “HTTP Error when uploading images to WordPress”.

Fix:

htaccess file Edit Option

To fix this problem, you can add the following code to your .htaccess file.

 SetEnv MAGICK_THREAD_LIMIT 1

This code limits Image Magick ( Imagick ) to use a single thread to process the image. Try re-uploading your image and checking if the problem is solved. There is a chance that the problem is resolved. If the problem remains, then here we have two codes.

 

<IfModule mod_security.c>

SecFilterEngine Off

SecFilterScanPOST Off

</IfModule>

Or,

<FilesMatch “(async-upload.php|wp-cron.php|xmlrpc.php)$”>

Satisfy Any

Order allow, deny

Allow from all

Deny from none

</FilesMatch>

 

[Expel the file upload and WP CRON scripts from authentication]

Before you edit anything to make sure you have a backup file.

Tips 7: Change Or Edit Your Themes

If you have transferred into a new theme to WordPress and facing the error problem then the theme may be the culprit here. Once you create a backup file, you can switch to a default WordPress theme.

If the default theme works perfectly, then you can go ahead with it or if you think you may want to stay with your recent theme then you may change some function.

First, go to your admin panel after that Appearance > Editor

WordPress Appearance Editor

Next, go for “Select theme to edit” and search your theme name.

Edit Theme Options

Then, you will see “Theme Function” beneath the Search file.

WordPress Theme Function

After doing that you can see a pile of code into it. Do not change any of the code if you do that it will impair your theme system. Normally, go to the finish line of the code area and copy the below code and paste there

add_filter( 'wp_image_editors', 'change_graphic_lib' );
function change_graphic_lib($array) {
return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
}

WordPress Appearance Editor Options

In the end, just click “Update File” and you are done.

Tips 8: Change your Default Image Editor

WordPress process the images with the help of two image editors –

  1.   Imagick Editor
  2.   GD Library Editor

While GD Library is familiar for its impressive performance, Imagick is overlooked to drain the memory and is the key reason behind the HTTP Error. Although they are good at performing among the other editors.

To dodge this issue, you need to make GD Library your default editor. To do this simply drop this code into your theme’s functions.php file:

function hs_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', 'hs_image_editor_default_to_gd' );

Adding this code to the functions.php, try re-uploading the image. If your problem is solved it’s good otherwise reverts this code and try to find another solution.

Tips 9: Rename File

Sometimes the file is not supported for not using proper languages other than English or save into different characteristics like symbols. Try changing the symbols or the language to English and upload the file again.

Message From Webpage

Tips 10: Resize File

According to WordPress, you should resize your image. By reducing the file’s height and width can solve this problem. You may find a third-party image resize tool into google. When you’re done with resizing the image then upload it media library to see the issue even remains or not. If you eager to resize your image then go to the link,

https://picresize.com/

PicRisize

Tips 11: Switch Browser

It might be possible (the possibility is quite less) that the HTTP Error when uploading images to WordPress is unrelated to the website and browser is causing the issue. You may try switching the browser and re-upload the image.

Web Browser List

This may solve the problem. If not, move on to the other solution.

Tips 12: Clear Cache

Try this is a simple trick, but could work if you haven’t cleared your cache. Try clearing all your cache from the browser and retry uploading the media files again.

Clear Browsing Data

Tips 13: Media Library Path

Inappropriate setup of the media library path may also be a reason behind HTTP Error when uploading images to WordPress. To solve this, you have to go to the “media” in your dashboard and then to “settings”. Now there you can find a file path value listed, remove it and save changes according to WordPress.

WordPress Media Settings

Tips 14: Change Image Extension

Many times, WordPress restricts specific files type from upload for security. This can too cause the HTTP Error when uploading images to WordPress. It can be done just by changing or converting image extensions to .png to .jpg.

png or jpg

Tips 15: Consult with your WordPress Host

If you have tried all the tips which were given and don’t work any of them then it will be better for you that you should talk with your host for support.

Setting Icon

Conclusion:

I hope your problem is solved. If there is any problem you face trying to apply the tips just leave a comment for us, we will help you to fix the issue.

You May Like:

How to Install WordPress Using FTP

How to Install WordPress on Xampp

Leave a Reply

Your email address will not be published. Required fields are marked *