TimThumb.php – 500 Internal Server Error

I haven’t been using TimThumb for my dynamic image resizing and cropping for a while now. There is a good script by the guy called Syamil who runs Aqua Graphite that uses the WordPress built in functions -> you can see it here;


I’ve seen it incorporated into a few commercial WordPress themes. There’s also this one by Matthew Ruddy which I really like;


These methods are great – you can say good bye to the description in a metabox or your docs saying ‘use an image XXpx wide and YYpx high’ to the client (who probably doesn’t have a clue how to resize and optimise images using a graphics editor). All the goodness of TimThumb cropping but using the built in WordPress functions.

However – the reason for this blog post is that you may have to work on a site which already uses TimThumb. There’s no specific need to convert all the scripts, although TimThumb had a well publicised security hole, v2 got completely refactored. It’s home page is Binary Moon – and hats off to Ben the author. $250 an hour he’s charging for support and he’s saying he’s so busy he might take weeks to get back to folk. Lol, mate hire a secretary and a team of people if that’s the case. Good on him.

So I had to transfer a WordPress site which has been sitting on my dev server for 1.5 years (yup – and it’s been worked on all the time by them, extraordinary!). The TimThumb images in the slider and featured images holder weren’t working at all, so after running through Ben Gillbanks troubleshooting list I had to look for something else.

Luckily ran across this one;


The comment by Olegnax is the key. It’s a security setup on the server which the hosts will have set but the person you deal with might very well not know about. If you receive a 500 Internal Server Error message on images resized by TimThumb, please check the following:

  1. 1. Check to make sure the file permission is set to 700 (read, write, and execute for owner only).
  2. 2. Check the Directory (folder) permission. Setting it to 777 will give you a 500 – Internal Server Error. Set it to 711.

Worked for me.