Are you seeing HTTP error while uploading images, pdf, video or other media files to WordPress? HTTP error when uploading images is one of the most annoying things that can happen to your WordPress website.
Before we start discussing how to to solve image uploading issues, lets first talk about what causes this error.
What is HTTP error when uploading images in WordPress?
The WordPress HTTP Error is usually displayed on shared hosting after trying to upload an image in the media screen and the upload fails. Hopefully, you won’t be getting this error and will only see it on this screenshot:
Why Did I Get HTTP Error?
The short answer is: because WordPress was unable to determine the exact reason behind the image upload failure and therefore it displayed a simple and generic message – HTTP Error.
This is where the things get interesting if you’re like me and love troubleshooting/bug hunting (if not just skip to the next step) since WordPress doesn’t know the exact reason why this error happened, you have to try out various solutions to fix the issue.
So let’s take a look at how to troubleshoot and fix the HTTP error during media upload in WordPress.
Check Server Resources
The first thing that you want to do when you get this error is to try to upload the image again!
If this doesn’t work make sure that you are not running out of resources on your hosting package! Login to cPanel and on the right you will see the statistics section which highlights your account’s usage of resources.
In a lot of cases, the reason why you get this message is that you’re out of space! If that’s the case remove unused files from your server or contact your WordPress hosting provider to upgrade your package.
Increase WordPress Memory Limit
The most common cause of this error is lack of memory alocated for WordPress to use. To fix this, you simply need to increase the amount of memory PHP can use on your server.
You can do this by adding the following line to your wp-config.php file.
This will increase the WordPress memory limit to 256MB, which would be enough to fix any memory limit issues.