Fixing HTTP Upload Error in WordPress

Fixing HTTP Upload Error in WordPress

Adam Morgan

Are you trying to upload media in WordPress but keep finding the HTTP error being displayed? Then carry on reading to find out how you can resolve this issue to upload media files with ease.

What Causes This Issue?

There is a multitude of reasons that can cause an HTTP upload error. When this happens, it simply means that WordPress cannot work out the cause and so an error message is flagged up instead. The error message won’t let you know the cause, however, so you will need to take the following steps to solve the issue.

Is the HTTP Upload Error Temporary?

The first thing that you will need to establish is whether or not the HTTP error is temporary. Take a break for a few minutes, then return and try uploading your media file again. Occasionally, there can be issues with out of the ordinary traffic or low server resources.

Still can’t upload your image? Then try uploading a different media file! If this uploads it could be that your other file is too large and needs to be saved as a smaller file before reuploading.

Finally, try saving the file in a different format. If none of these options work, then this is more than just a temporary glitch!

Increase Your WordPress Memory Limit

For most people, the problem tends to be a lack of memory space available in WordPress. This can easily be resolved. Simply increase your PHP memory on your server using the code ‘WP_MEMORY_LIMIT’, 256M. Add this the wp-config.php file. This should resolve any memory issues as this will increase the memory limit to 256MB.

Select a Different Image Editor Library

When using WordPress, it will run on PHP and there are two modules here that deal with images – Imagick and GD Library. The problem here is that Imagick can have bad memory issues which cause the HTTP upload error to appear. To solve this problem, simply make the GD Library the default image editor instead. To achieve this you can add the code the WordPress theme’s functions.php file or a site-specific plugin.

Apply the .htaccess Method

If none of the above methods work to solve the HTTP upload error from appearing, you may have to use the .htaccess method instead. With this method, you can control how Imagick uses the server resources. Using multiple threads for faster image processing can be limited by shared hosting providers, causing the error message to appear. To combat this, you can simply add the code SetEnv MAGICK_THREAD_LIMIT 1 to the .htaccess file. With this code, you will be limiting Imagick to using just one thread to process images.

If you know of any other ways to resolve an HTTP upload error in WordPress, make sure to leave a comment below!

Adam Morgan

Author Adam Morgan

More posts by Adam Morgan