Other

wordpress http error crunching .htaccess

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.

Written on December 13th, 2009

81 Responses

  1. Douglas Porter

    December 19th, 2009 at 9:01 am

    Thank you so much! I’ve looked all over for a fix that actually works.

  2. Gecko

    December 30th, 2009 at 5:37 am

    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 :)

  3. Jeremy

    January 4th, 2010 at 6:33 pm

    WOOOOOHOOOOO!! Thanks a million. Nothing else worked, but this one does.

  4. Phil

    January 20th, 2010 at 1:16 pm

    THANKS!!! I’ve been bashing my head in looking online for solutions to this problem! Your method worked perfectly.

  5. Beth

    March 1st, 2010 at 12:11 pm

    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!!

  6. admin

    March 1st, 2010 at 2:03 pm

    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!

  7. Beth

    March 1st, 2010 at 3:09 pm

    Hmm…I tried creating the file but it looks like that didn’t do it either. Now I have the file but it does nothing! So strange.

  8. Cid

    March 15th, 2010 at 7:59 am

    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!

  9. Keith Hobin

    March 17th, 2010 at 9:00 pm

    Thanks! This fix worked like a charm!

  10. Joseph Daily

    April 11th, 2010 at 5:06 pm

    Fantastic! This was driving me crazy. Thanks so much!

  11. Ben

    April 19th, 2010 at 10:36 am

    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

  12. Jared

    April 24th, 2010 at 7:46 pm

    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.

  13. Patrick Bach

    May 13th, 2010 at 6:44 am

    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?

  14. admin

    May 13th, 2010 at 4:39 pm

    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.

  15. Jonathan

    May 19th, 2010 at 10:48 pm

    Brilliant!

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

    -Jonathan

  16. Richard

    May 24th, 2010 at 9:12 am

    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

  17. Abz

    June 2nd, 2010 at 9:50 am

    Cheers! The snippet worked wonders two thumbs up. :)

  18. Ben Lind

    June 14th, 2010 at 3:49 pm

    YES!!!! This works! Everything else I’ve tried has failed – thanks so much!

  19. Paul C

    June 21st, 2010 at 3:33 pm

    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

  20. Marie

    June 22nd, 2010 at 5:21 am

    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.

  21. Nate

    June 27th, 2010 at 1:49 pm

    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.

  22. admin

    June 27th, 2010 at 2:03 pm

    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!

  23. Rachel

    July 13th, 2010 at 11:09 am

    Thank you, thank you, a million times thank you for this!

  24. DAgo

    July 27th, 2010 at 12:32 pm

    Thank You… your solution fixed the problem

  25. Kennith B. Inge

    August 6th, 2010 at 5:08 pm

    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!

  26. Brandon

    August 15th, 2010 at 9:34 pm

    This worked Great! Thanks!

  27. Amos

    August 27th, 2010 at 12:06 am

    THANK YOU!
    Finally someone that knows what the hell they’re talking about.

  28. Adam Hermsdorfer

    September 3rd, 2010 at 4:23 pm

    Worked! Kudos for posting this article, it saved my image uploader!

  29. NLC

    September 13th, 2010 at 11:23 pm

    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

  30. Sly

    September 19th, 2010 at 12:04 pm

    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); } ?>

  31. The 66giant » Blog Archive » WordPress Error Uploading/Crunching Photos

    September 21st, 2010 at 4:46 pm

    [...] wordpress http error crunching .htaccess « Jon R Wilson’s Blog | Thoughts on product design (…. Quick Tips [...]

  32. Will

    September 26th, 2010 at 1:58 pm

    Thanks very much! Saved me a great deal of time.

  33. DouglasVB

    September 27th, 2010 at 1:28 am

    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.

  34. Rae

    October 4th, 2010 at 5:06 pm

    Another 1&1 user that is forever grateful to your post. Thanks! This was such a frustrating problem.

  35. PTCBots

    October 14th, 2010 at 5:51 am

    Wow!!!
    Thanks finally one method that solves the \HTTP Error.\ problem! Thanks!

  36. GrahamP

    October 21st, 2010 at 4:02 am

    Thanks a million! this works – like other posts this has fixed my upload problem on 1&1

  37. Recep

    October 22nd, 2010 at 8:56 am

    had the same error after this line.

  38. Eshaver

    October 23rd, 2010 at 10:47 pm

    Hallelujah! Something that finally works. Thank you!

  39. Kevin Harrington

    November 9th, 2010 at 7:16 am

    Jon, you beautiful person. Thank you for this fix.

  40. maryelle

    November 9th, 2010 at 6:53 pm

    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.

  41. red

    November 10th, 2010 at 2:21 am

    Did not work. My search for a fix continues…. Thanks for the suggestion though!

  42. Richard

    November 13th, 2010 at 12:43 pm

    Thank you so much for this, it was making image management a nightmare. Now I can really get my new blog up and running. http://www.blog.brown-family.org.uk

  43. wordpress-http-error-crunching | Richard & Caroline's Blog

    November 14th, 2010 at 4:10 am

    [...] spent sometime looking at the WordPress help pages but eventually I found the answer here:  Just adding the [...]

  44. John

    December 7th, 2010 at 4:04 pm

    YES!!!! THANKS YOU!!! That was the ticket.

  45. Will S

    January 7th, 2011 at 4:42 pm

    Not only has this fixed my image upload problems, various plugins that refused to work are now working perfectly.

    You, sir, are a total star!

  46. neil f.

    February 17th, 2011 at 3:01 pm

    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.

  47. Sam

    February 28th, 2011 at 1:11 am

    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?

  48. Steve Crenshaw

    February 28th, 2011 at 8:16 pm

    Awesome fix, Thanks so much. I worked on this for 4 hours before finding this page.

  49. ClearGlass

    March 2nd, 2011 at 2:27 am

    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!

  50. WebGeekCebu

    March 3rd, 2011 at 11:01 am

    wow! It works! It saves my day! Thanks!

  51. NiftyTeam

    March 9th, 2011 at 10:24 pm

    THANK YOU!!!
    Works beautifully! Really appreciate you taking the time to put this up.

  52. Toscan

    March 28th, 2011 at 1:36 pm

    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.

  53. Jeff

    May 26th, 2011 at 3:08 pm

    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!!!

  54. Scott

    June 26th, 2011 at 12:53 pm

    This worked! You are the man, thank you for publishing this so I didn’t have to spend all day on it like a couple other people….

  55. Clint

    June 30th, 2011 at 9:32 am

    Well done sir, this was driving me crazy!

    Thanks

  56. Celebrity Bikinis

    July 4th, 2011 at 3:08 am

    Thanks for this, worked like a charm.

  57. Miguel

    July 6th, 2011 at 10:44 am

    Sorry, but i didn’t work for me and it is driving me crazy.

  58. Thomas Taylor

    August 21st, 2011 at 8:37 am

    Hello, I have try your way, but it didn’t work with me, I use godaddy hosting how can I fix it !

  59. MrsBumble

    September 22nd, 2011 at 12:48 pm

    I have the same problem as above ‘Thomas Taylor’ and relatively new to this. Does anyone know how to fix if using Go Daddy? So frustrated.. :0(

  60. Stacey @ Tree, Root, and Twig

    September 23rd, 2011 at 5:01 pm

    Worked perfectly! Thank you!! (ps: I host on godaddy, too, and had no problems.)

  61. Dom Search

    December 2nd, 2011 at 3:44 pm

    As is clear from this thread there maybe other reasons why uploads fail in your case, so always check the error logs for your site’s virtual host.

    The error logs for the site I’ve just fixed said “mod_fcgid: HTTP request length 132005 (so far) exceeds MaxRequestLen (131072)”. In this case the web server uses Apache plus the mod_fcgid Fast CGI module (http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html), and had nothing defined for FcgidMaxRequestLen in the Apache config file (the default is to allow a max http body length of 131072 bytes). I added “FcgidMaxRequestLen 134217728″ to the config file to set a max of 128MB, restarted Apache, and the upload problem was fixed… no need to edit move or copy WordPress’s .htaccess file.

  62. Endri

    December 11th, 2011 at 1:22 pm

    Hello, Two weeks ago I installed a plugin and I got an error saying that the htacces is very small and if my site is working properly to ignore this issue so I ignored it but I am concerned if this can cause me any troubles in the future. What do you think. Is this normal?

  63. Jon

    December 11th, 2011 at 1:52 pm

    Was is a warning that the memory was low? Depending on your network/server set up you might be able to set it to give you more memory. I don’t know how to do this, mostly b/c this is hosted on a shared 1&1 server, so I’m limited to a small amount of memory. Good luck!

  64. Richelle

    January 30th, 2012 at 3:14 pm

    What if I did not make the site? How to i access the .htaccess file? I do not know code at all.

    Thanks.

  65. Juanzo

    February 6th, 2012 at 11:25 pm

    Kudos for this, it worked like a charm.

  66. Rene Elkaslasy

    March 17th, 2012 at 9:01 am

    I just got a new hard drive put into my computer and now I searched for the wp-admin folder to add the htaccess code. Am i missing a program or a driver?

  67. Reginald

    April 30th, 2012 at 7:59 am

    Thanks but it doesn’t work for my site. When I open the file, I saw those Begin W3 Total Cache thingy. Added at the top and all alignment went hairwire. I added below and right above begin WP and same problem.

    Guess something was wrong since I got w3 total cache?

    Please advise.

  68. abhishek

    May 1st, 2012 at 7:51 am

    unfortunately this didnt worked for me , the error is still there

  69. michael soriano

    May 11th, 2012 at 12:19 pm

    awesome. so far so good. the funny thing is – it used to work without this entry in the .htaccess. so now why is it acting up?

  70. Philip

    May 17th, 2012 at 3:32 pm

    So, the solution in the end was have support go through several possibilities. At first, support thought it was WordPress itself creating the errors, but infact it was simply a case of turning off FastCGI in the PHP options/manage domain panel and switch it to PHP 5.3xCGI.

    Now, images upload without a issue. Hopefully this will help someone else with the same problem.

  71. Plamen

    June 1st, 2012 at 9:51 am

    It gives me an 500 error when I try to enter in my site :(

  72. Scott Forsyth

    June 1st, 2012 at 12:47 pm

    I ran into this issue too for WordPress on IIS using PHP 5.3. It only occurred for large files. The issue turned out to be max_input_time (and maybe max_execution_time) in php.ini. It defaults to 60 seconds (1 minute) which wasn’t enough for the size of the files we are uploading.

    The error log at C:\Windows\Temp\php53_errors.log mentioned max_execution_time being reached. But every time I raised max_execution_time it would fail and the error message would reflect the new number until I was using 12000000 for a file that took about 1 1/2 minutes to upload. Obviously it wasn’t really using that number even though the error message said that it was. I took a guess at max_input_time by raising that to 1800 and after that it was good.

  73. someonefromegypt

    September 28th, 2012 at 12:00 pm

    what a miracle. Thanks a lot man.

  74. jason

    December 2nd, 2012 at 7:03 am

    Got this after I did the edit. It showed up where you can select the image size after crunching and replaced everything.

    post_type ) wp_die( __( ‘Unknown post type.’ ) ); $post_type_object = get_post_type_object( ‘attachment’ ); if ( ! current_user_can( $post_type_object->cap->edit_post, $id ) ) wp_die( __( ‘You are not allowed to edit this item.’ ) ); if ( 2 == $_REQUEST['fetch'] ) { add_filter(‘attachment_fields_to_edit’, ‘media_single_attachment_fields_to_edit’, 10, 2); echo get_media_item($id, array( ‘send’ => 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); }

  75. Jon

    December 2nd, 2012 at 1:52 pm

    Hi Jason,

    I’m no expert, but hopefully someone else will know the answer?

  76. jason

    December 3rd, 2012 at 5:04 am

    ok i got it. for some reason, my wordpress install (on Surpass Hosting) doesn’t like the photos. It works when I resize them to 800×600. Before it was 1024×768

  77. Gray

    March 9th, 2013 at 3:15 pm

    I ran into the HTTP Error” when uploading a bunch of images to one of my blogs. However, only with some images. After some experimenting, I discovered that even through the files where small in size, the images were still quite large. I changed the dimensions on the images that I had problems to to match the others, and they processed without an error.

  78. Lolo

    May 30th, 2013 at 4:06 am

    Not helped to me… But I wrote to my host, and they set PHP from 52 to 53 and it got fixed.

  79. Chinty Line

    September 15th, 2013 at 6:42 am

    I’ve got the almost similar problem, then just tried your solution. Unfortunately, it was unwork. Suddenly I realized: “Written on December 13th, 2009″

    Any way, thank you.

  80. Rohan

    November 18th, 2013 at 3:31 am

    I have the same issues, but the solution didn’t work. Can someone help? here is how my.htaccess file looks like. It was in the root folder, I moved it to wp-content. Still no luck.

    # -FrontPage-

    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

    order deny,allow
    deny from all
    allow from all

    order deny,allow
    deny from all

    AuthName rohanjuierie.com
    AuthUserFile /home/rohanjui/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/rohanjui/public_html/_vti_pvt/service.grp

    # BEGIN WordPress

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

    # END WordPress

  81. Juan

    June 12th, 2014 at 8:50 pm

    Thanks!
    I have the same problem in JUNE 2014 (today) for a complete new site that i’m developing in wordpress and this solution save me!!!
    THANKS AGAIN!

Leave a Reply