WPorb

✔️ How to fix HTTP Image Upload Error in WordPress

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:

http upload failed wordpress 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.

The first thing that you want to do when you get this error is to try to upload the image again!

Резултат слика за giphy 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.

cpanel error wordpress limit

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.

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.

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

This will increase the WordPress memory limit to 256MB, which would be enough to fix any memory limit issues.

File uploaded successfully wordpress

Another way to increase PHP memory limit is to edit the php.ini file located in your root directory. Open the file with text or code editor and increase the value for the memory_limit setting.

 Increase PHP Memory Limit with .htaccess

.htaccess file is another hidden file same as php.ini so to show it please enable it in the settings, like showwn on the screenshot below:

 Increase PHP Memory Limit with .htaccess

Open the .htaccess file with editor and change the “php_value memory_limit” value.

Add comment

Do you have a
WordPress problem?

Select what best describes your goals:

HOLD ON!

Do you have a
WordPress problem?

Become a WordPress Pro
with our easy to follow guides .

Hire an Expert to quickly solve
any WordPress related task.

We use cookies to provide an awesome experience on our website. By continuing to use this site, you agree to our tasty cookies.
🍪 Accept Cookies
Privacy Policy