407 thoughts on “TimThumb Troubleshooting Secrets Leave a comment

  1. Hi, I followed all the instructions but I can’t view images!
    I don’t know even how to put the article Featured
    Help me

  2. Hi Getting Following error :

    A TimThumb error has occured
    The following error(s) occured:

    No image specified

    Query String : page=home_slider
    TimThumb version : 2.8.10

    I have used latest version of timthumb.php

    Can anybody please Help !!!

    Thanks in Advance

  3. Pingback: Migrating Timthumb
  4. I’m helping a developer get a new site up and running on one of a university server and we’re getting the 400/Bad Request error for the timthumb images. I’ve tried every trick in this thread but can’t find any issues on the server side of things (not ruling it out, but no server errors in log).

    If parameters in URL are stripped, images show, e.g.:

    Good request:
    Bad request:

    Any ideas what could be causing this?

    1. Ok, fixed this. I’d tried setting permissions to 777 and 755, turns out 664 did the trick. Web server did not like the executable permission setting.

  5. timthumb thows up an error when fetching images that have an apostrophe in the filename. The call is:
    and timthumb’s error report is:

    “Query String : src=http://upload.wikimedia.org/wikipedia/en/f/f3/Don%27t_Panic.jpg&h=35&w=35&zc=1”


  6. Hi, I’m having problems getting thumbs to show properly on http://triathlon.no – any help appreciated.
    Some images appear/disappear on refresh? I’m baffled!

    Thanks in advance, and Merry Christmas!

  7. Hi Ben, how are you? I’m really hoping you can help me.

    For the last year I’ve been running our photography company’s website on WordPress. Everything’s been running great and then all of a sudden a couple weeks ago our thumbnails stopped working for no reason at all. We hadn’t made any changes to the site, theme, or WP version.

    Here is an example of a problem page:

    Since the site is a photography company site, the majority of it is photos and now none of our gallery thumbnails work, this is not good at all. =( The images are still there and if you click on the broken thumb, the image still loads up.

    I’ve done tons of research and checked everything mentions on your site too and I can’t for the life of me figure out what the problem is. I’ve looked at the permissions so many times too…. =(

    If you have any ideas what the problem might be I’d be forever grateful to you. Please help.


    Erin Fraser

      1. Hi Ben,
        Thanks for the reply.

        I’ve made a discovery. After putting a whole new WP installation on and trying a few test photos, it seems the only photos/thumbnails that work properly are the ones who have underscores in their file name. If they have dashes in the file name the thumbnail is broken.

        Have you heard of this happening before? Do you have an idea of how to fix it?

  8. Kudos to Ben! Changing the permissions from 755 to 777 on the cache folder solved my site’s problem of not loading the images! Thanks!

  9. So, I have TimThumb 2.8.11 working without a problem and thanx … it is a really nice, convenient script for what I need.

    My question is in regards to the cache files … do I have to create a script that will delete them periodically? or does TimThumb do that itself?

    just curious as I do not want to have thousands of state cache files sitting around on my server



  10. Hi there,

    I recently moved http://www.footy.co.za to a new host, but for the life of me, can’t get timthumb to work.
    I have gone through all the permissions & setting of folders, but still having no joy. Is there something I am missing ?
    Any help would be greatly appreciated !

    Thanks in advance

  11. Pingback: Leo Tomas's | Timthumb error: thumbnails not displaying on WP3.5
  12. To all other readers, do not set your `cache` folder permission to 777, set it to 755. You’ll get easily hacked if you follow the permission he posted here.

  13. Great script!

    Question – Whats the best way to keep updated on the latest releases?

    For example i just found out today that you went from 2.8.10 to 2.8.11 last month…

    Without checking in every day I don’t see a newsletter or anything that would send me notification of these changes.

    Please advise.



  14. Pingback: TimThumb- 500 Internal Server Error, Permissions, Wordpress Freelancer Leeds
  15. Hey πŸ™‚
    Thanks for your work and sharing with us! I’m using Website Screenshots and spent some time searching for the reason why they’re always cropped to 800 x 600 – no matter of the adjustments in WEBSHOT_SCREEN_X / WEBSHOT_SCREEN_Y

    It’s easy: Tell CutyCapt this resolution too! πŸ˜‰
    In timthumb.php (2.8.11) add –min-width={$screenX} –min-height={$screenY} to $command at line 970 and 972 and you’ll get what you want.

  16. Hi Ben,

    thank you for creating TimThumb!

    I have the problem that with every request a new cache file ist created. When I Refresh the page a new cache file ist created (for one image) every time which results in a lot of cache files for the same image!?

    For example image “test.jpg”:
    Request 1 -> Cache file is: ./cache/timthumb_int_46b8d758e92c92194fe777812b5e1256.timthumb.txt
    Request 2 -> Cache file is: ./cache/timthumb_int_55e1665e99490a3cdf486ee69294e9ba.timthumb.txt

    It seems that the earlier created cache file ist not found by the script!? Or is this normal behaviour?

    Thank you in advance and best regards,

  17. i used it on my website but i found many problems, images dont appear on the website and hadn’t been created on the cache folder

  18. Pingback: Timthumb image thumbnails not appearing on wordpress site - Tech Forum Network
  19. Hi Ben,
    I have follow all the instruction, but I come up with this one:

    Warning: tempnam() [function.tempnam]: SAFE MODE Restriction in effect.

    A TimThumb error has occured

    The following error(s) occured:
    Could not open the lockfile for writing an image.

    Any Idea? Need Advice.


  20. Hey Ben,

    Wondering if the issue with the thumbnails not appearing is solved. Just shows a thing empty box there the thumbnail is supposed to be. Was working with the test images I was working with, but once I started uploading the images I need to use, the thumbnails are not showing. Figured out everything else I need but this.

    Please let me know.

  21. Does timthumb require touch() to function properly?

    Been beating my head against a wall for some time trying to get it to stop erroring out. Wondering if that is why?

  22. So it turns out that the script breaks if you don’t have touch() enabled…even though as far as I can see it only uses touch() for error checking. In other words if touch() is disabled (common for security) the error checking effectively breaks the script even if it’d otherwise be working fine.

    Please include this in your troubleshooting guide! I wasted probably 5 hours pulling my hair out trying to follow the (non applicable) error messages, thinking I had somehow reconfigured something.

    If anyone else runs into:

    Warning: touch() has been disabled for security reasons in /home/fresoil/public_html/templates/ammon/php/img.php on line 200

    Warning: touch() has been disabled for security reasons in /home/fresoil/public_html/templates/ammon/php/img.php on line 469

    Warning: Cannot modify header information – headers already sent by (output started at /your/directory/structure/here/timthumb.php) in /your/directory/structure/here/timthumb.php on line 418
    A TimThumb error has occured

    The following error(s) occured:
    Could not create the index.html file – to fix this create an empty file named index.html file in the cache directory.
    Could not create cache clean timestamp file.

    Query String : src=http://somewhere/image.png&w=290
    TimThumb version : 2.8.11

    Here is what you do to fix it:
    Either enable touch on the server, or simply comment out lines 200-202:

    if (!touch($this->cacheDirectory . ‘/index.html’)) {
    $this->error(“Could not create the index.html file – to fix this create an empty file named index.html file in the cache directory.”);

    and lines 461-463:

    if (!touch($lastCleanFile)) {
    $this->error(“Could not create cache clean timestamp file.”);

    This should be fixed or at the very least documented.

  23. I know this is a long shot, but please help. I cant get the images to show on my site http://www.sparklesandbows.co.uk sure its probably something simple but i’m stuck and cant afford to pay the amount you want for support πŸ™ I have been through all your hints and tips and still no joy. Please help?

    1. Hi Emma – your images do not have an image url supplied. You will have to ask your theme supplier how to specify the image with your theme.

  24. If an image is not working and you are using WordPress, you should also check the Security…Tweaks…Server Tweaks. If “Filter Suspicious Query Strings” is checked, it may prevent timthumb images from being displayed and instead gives a 403 – Permission Denied error.

  25. The last secret says: “index.html – to prevent the cache files from being browsable an index.html file is created in the cache directory. This file should have it’s permissions set to 666”

    666 means the public can write this file, my question is why does the public needs to write this file?
    Shouldn’t 664 be enough?

  26. Hi,

    I think I have some problem with the images displayed on the homepage of my website’s slider as it is using timthumb. As you could see, the sixth slide is unable to display the slider image. Some help will be highly appreciated.

Leave a Reply

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