Aside

Fixing 403, 404 and 500 errors when using timthumb.php

Many new WordPress templates have been incorporating the timthumb.php thumbnail generator.

If you run into any 403, 404 or 500 errors when implementing timthumb, here are a few tips:

  • Make sure the timthumb.php file has its permission set to 775
  • Make sure the “cache” folder’s permissions are set to 775. The cache folder is generated the first time you try to run timthumb. It is located within the same directory as the timthumb.php file.
  • If you host your website on HostGator, you will need to ask them to change a few settings within mod_security for Apache. This is a documented issue with timthumb usage on Host Gator. Below is an email I sent to them making my own request:

    Dear Host Gator,

    I recently updated my WordPress website with a theme that uses the
    timthumb.php thumbnail generator.

    I have learned that in order for it to work properly HostGator needs to
    change a few setting for my website. When I try to run timthumb I receive
    a 403 error.

    I need the following rules [1234234,340151, 340153] added to mod_security
    for www.recommendedwebtools.com.

    Please let me know if there are any questions or concerns.

    Thanks!

    Contact Host Gator at their support email address. They responded within the hour and the setting was changed shortly thereafter.

Happy Thumbnailing!

[Email Newsletter]

About Paul Flyer

Paul Flyer loves helping small businesses and non-profits extend their web presence. He writes and maintains this blog to share resources and tools for building, maintaining and promoting websites. Need help with your own website?.

9 Responses to Fixing 403, 404 and 500 errors when using timthumb.php

  1. Lior Sion August 19, 2009 at 7:13 am #

    wow. Wow. wow. Thanks. Even included your sample email :) thanks again!

  2. Keith Douglas | Real World Muse Building November 16, 2009 at 5:16 am #

    Thanks Paul! I’ve spent all weekend trying to fix this. Much appreciated.

    Keith

  3. Creare Studio December 11, 2009 at 10:42 am #

    I was wasting too much time trying to run the script, and now is working on a shared account from Hostgator. Thanks!!

  4. tim wizba February 26, 2011 at 9:01 pm #

    My image sliders quit working a few days after installing a new theme from pexeto (with timthumb.php) called dandelion. Couldn’t figure out the problem with the image resizing? This post lead me to contact hostgator and now everything is back online. Thanks for posting this, it saved my sanity.

  5. Paul Flyer February 26, 2011 at 9:07 pm #

    Tim,

    I’m happy that post was helpful!

    Paul

  6. JW March 14, 2011 at 4:32 am #

    You Legend. I was having the same problem as Tim above. My WordPress theme simply wasn’t working as expected. I would never have guessed it was a HostGator problem unless I’d found this page. Thank you!

  7. Paul Flyer March 14, 2011 at 6:18 pm #

    JW – glad you found the post and glad you got your theme fixed!

  8. Jim June 23, 2012 at 2:13 pm #

    Thanks so much for this fix! I have been searching for the last two hours and as soon as I called tech support – they new exactly what to do!! Much appreciated!!

Trackbacks/Pingbacks

  1. Yaz? Bir @Aziz Vicdan Aziz Vicdan - March 13, 2012

    [...] to contact the support and ask them to make your server settings compatible for timthumb. On the this pageyou can find an article with an email template that you can use to send them the [...]

Leave a Reply