wordpress http error crunching .htaccess

Fix the common Wordpress image upload http error while crunching. Just add “AddType x-mapp-php5 .php” to the top of your .htaccess file! (Wordpress 2.8.6)

The Problem:
Whenever I would try to upload an image to my blog the file would upload, but I would then get a red http error, as seen in this picture below:

 

http wordpress crunching error

 

With this error it wasn’t possible for me to choose the preset image size “medium”, which I configured to the width of one column. Here is what I’m talking about:

 

affected by error

 

The Solution:
Just open your .htaccess file that is in the same folder as your wp-content folder:

 

where htaccess

 

and add “AddType x-mapp-php5 .php” to the top, as so:

 

edited htaccess

 

Once you save that, you should be able to upload pictures without the error and regain wordpress’s resizing feature.

 

upload error fixed

 

I got this little snippet from errors when installing either joomla or drupal, so when this http error came up, I figured it couldn’t hurt if I add it to .htaccess for wordpress and it worked! Hopefully this helps since online I didn’t see anyone else recommending this fix.

85 thoughts on “wordpress http error crunching .htaccess”

  1. Correct you are ! Thank you very much. This is something I’ve had to add to almost all of my htaccess files, but had neglected to do with my wordpress powered sites. So many crazy answers on how to fix this problem, this is the right one (at least if you have Linux hosting)
    Thanks again, saved me a lot of BS tonight šŸ™‚

  2. Do you know what to do if you don’t have a .htaccess file? I’m showing my hidden files on my computer and it’s just not there. Which is a huge bummer…because I think this is really the right solution!!

    1. Beth,
      When you were showing hidden files on your computer, you were looking at the folder on your server, where your WP blog is hosted right? I actually don’t know all that much about this, but I thought that the .htaccess file had to be there since wordpress installs it. Maybe this isn’t the case? If you are sure you are looking in the right folder, then with no certainty I would say that it can’t hurt to create the file with the mentioned contents above, and it might just fix your problem. Let me know!

  3. Thank you SO much!
    I have encountered this error many times, and this is the first solution that really always seem to work. Great, thanks again!

  4. Hi:
    I tried your suggestion above but it did not work. I was hoping you could look at my .htaccess file (pasted below) and let me know if there is anything else I need to do.
    Thanks a lot for the help in advance.
    Ben

    addhandler x-httpd-php-cgi .php4
    addhandler x-httpd-php5-cgi .php5
    addhandler x-httpd-php5-cgi .php

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

  5. Man… the guy at my hosting company just did that but I’m still getting that same exact error on a 25mb file. Anything else I can do? It’s already been like 3 hours and I called them 4 different times – of which they have no clue.

    Thanks so much.

  6. Tried it but it does not seem to work? The .htaccess is in the right place on the server but no change in the HTTP error result when trying to upload a big bitmap. What could be wrong?

    1. Patrick,
      I’m not sure, unfortunately I’m no expert when it comes to this. I’ve read a bit more about it, and it appears that what this fix does is demand apache 5 from the server instead of 4, which is the default on the servers provided by the host company 1&1 (which I use). I’ve also never tried uploading bitmaps, but I suppose there could be a size limit that you might be exceeding, I really don’t know though. Good luck!

      Also, seems like you work for a cool company, which has a nice website, but you might want to modify the opening flash so the words are readable independent of the background chosen. When the background is the military guy publications is unreadable since it’s white on white. A gradient could possibly solve that, or stroking the letters, if that’s an option in flash.

  7. Brilliant!

    Worked like a charm. Also using 1&1 hosting. Thank you for taking the time to post this fix!

    -Jonathan

  8. Is this the root .htaccess file. I am having the same problem and my .htaccess file has very little in it. I added the above code with no success. I am with 1&1 hosting using plesk. I tried uploading a pdf as well with the same issue

  9. I don’t usually comment, but I feel you deserve all the thanks I can give you right now. 1&1’s dodgy php hosting has been giving me a headache with wordpress uploads for weeks. That one line in the htaccess fixed it. Thank you <3

  10. Thank you, thank you, thank you.

    It wasn’t working but I was sure it was the answer as your screen shot was exactly the same problem I was having. For those who are saying it is not working or you can’t access you .htaccess file. Create a new one and ftp it into the root folder. Then in your ftp client right click and check the file permissions. You need to make sure it is executable. So give it a numeric value of 755 if not sure. I am using WordPress 3 and my client is hosting with 1&1.

    God bless ya for this, I have been going mad with all the random answers out there.

  11. Man, I tried this and all it does is destroy my WordPress editing page. All the php is shown unrendered on screen. Definitely does not solve the problem. I am not on 1&1.

    1. Sorry Nate, I believe this will only help those who are getting the problem because their server is using php4 instead of php5 (maybe your server only has 4, so when asking for 5 it just fails? wild guess…). Also ensure the permissions are set correctly or it might not work. If you figure out the problem let me know or make another comment for others in your situation. Good luck!

  12. Wow. Great job and many thanks. I was having a problem with this as well. Apparently I deleted my .htaccess file altogether and did not know during my upgrade to 3.01. Everything shut down–plugins, installing themes, etc. This has been a big help!

  13. I added that line and no longer got the http error, but instead got this…any ideas?

    Fatal error: Out of memory (allocated 32243712) (tried to allocate 2800 bytes) in /homepages/18/d313710871/htdocs/s3sportsphotography/wp-includes/media.php on line 253

  14. I have used your solution to fix that error, but doesn’t work.
    After adding the line in .htaccess, i have an error in upload pop-up

    false, ‘delete’ => true )); } else { add_filter(‘attachment_fields_to_edit’, ‘media_post_single_attachment_fields_to_edit’, 10, 2); echo get_media_item($id); } exit; } check_admin_referer(‘media-form’); $id = media_handle_upload(‘async-upload’, $_REQUEST[‘post_id’]); if ( is_wp_error($id) ) { echo ‘
    ‘ . __(‘Dismiss’) . ‘ ‘ . sprintf(__(‘ā€œ%sā€ has failed to upload due to an error’), esc_html($_FILES[‘async-upload’][‘name’]) ) . ‘
    ‘ . esc_html($id->get_error_message()) . ‘
    ‘; exit; } if ( $_REQUEST[‘short’] ) { // short form response – attachment ID only echo $id; } else { // long form response – big chunk o html $type = $_REQUEST[‘type’]; echo apply_filters(“async_upload_{$type}”, $id); } ?>

  15. It sadly didn’t work for me. I think that I’m running up against a memory or CPU limit with my webhosting company. It’s odd how it only happens sometimes and doesn’t happen every time on the same file.

  16. Oh my god whoever you are, I love you. Seriously. I’ve been trying to get this goddamn thing to work for MONTHS. I was ready to scrap the whole site and start over. Thank you, please contact me if you are ever in Atlanta and I will buy you a drink.

  17. Wow, that little code snippet just fixed a multitude of glitches on my site after upgrading from 2.9 to 3.0. The HTTP error went away, and now I can automatically update plugins and such which I couldn’t do previously. Thanks a million.

  18. I had high hopes after reading other 1&1 users making this work. However, with this .htaccess file, my entire site 500s. Anyone else seen this?

  19. Thanks so much for this post Jon! I’ve tried everything on the wordpress blog and have been searching for hours! I had this issue when switching to 1and1. People using them as their host should read this! You are the BEST!

  20. Had the same prob. to. Tried many of the sol. i thought were right.
    When i started reading this post, one thing hooked mt attention:

    The Solution:
    Just open your .htaccess file that is in the same folder as your wp-content folder:

    After reading this phrase, i moved my .htaccess file in my wp-content folder (it was in my root folder – in public.html).

    Now everything is fine. I can upload many images at the time with the Flash uploader. Did not need to insert AddType x-mapp-php5 .php in the file either.

    It’s the second time i fix this prob. The first time, i tought i had fix it by uninstalling and re-installing the latest flash player because it had fix the issue and i’ve been abla to work for a while until it pops back. Hope this time was the right one.

  21. You are a life saver!!! I worked the whole day to get this solved and I was ready to bash my head against the wall if I had to edit another file or try another plugin!!! Thank You!!!

Leave a Reply

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