Fix Image Upload “HTTP Error” on WordPress

Wordpress codingWhen uploading an image on my WordPress blog, I received a general error that said HTTP error. As a result, the image upload failed. Luckily, I quickly found a fix.

I recently upgraded my PHP version because of the speed improvement and the security patches. So I first tried looking for a permission mismatch somewhere, or a php.ini configuration typo or something along those lines. Even as a hobby web developer, it’s important to cover all possible areas.

To fix the image uploading error on WordPress, you should explicitly add this line to your .htaccess file. So go to the root of your WordPress installation (the same directory where you find wp-config.php). Open it and at the very top of that file, add:

AddType x-mapp-php5 .php

Now try again to upload a file and everything should be working fine again. HTTP error message resolved, ready to take on the next challenge you encounter in developing your website or blog!


Author Bio

Thank you for your interest in my blog! On this miniblog, I write mostly short (technical) blog posts that might interest other people. Read more about me or feel free to contact me.


3 thoughts on “Fix Image Upload “HTTP Error” on WordPress

  1. Additionaly, you could try to add the following line of code to wp-config.php

    define(‘WP_MEMORY_LIMIT’, ’64MB’);

    This will increase the memory limit.

  2. man followed your instructions (AddType x-mapp-php5 .php) and nothing worked. now my site’s ruined. whenever i go to the dashboard, it shows php code. how do i undo this?

  3. Paul, I’m assuming you didn’t download a backup copy of your htaccess file prior to adding the suggested code so you could simply re-upload the original, which would then overwrite the one that you altered.

    That being the case, couldn’t you just gain access to the public_html folder via FTP (using Filezilla or something similar) or via cPanel and then delete the code which is causing the problem, save the htaccess file and you should – in theory – have your site back to normal.

    I say in theory, because I’m also assuming you haven’t inadvertently deleted something else from the htaccess file that you shouldn’t have done when you had access to the file.

    Well, that’s my suggestion, you may very well have got the problem sorted by now, hope you have.

Leave a Reply

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