Latest News
TimThumb not displaying images? Let’s fix that!
44 Posted January 9, 2012 by Guru Frog Categories: Tips and TricksIf you’ve noticed that a number of images aren’t displaying correctly on your WordPress site, there’s a good chance that this has to do with the TimThumb script not working correctly. TimThumb is an image resizing script, often used for featured images and thumbnails. The problem is not isolated to eFrog Themes, but is widespread across a lot of themes that use TimThumb as an image resizing mechanism.
The good news is, we’ve found a fix for this, and the best part is, it’s just a simple, two step process:
- The first thing you need to do is ensure that your site is using the latest version of TimThumb. The easiest way to do this is to log into the WordPress dashboard, click on Appearance in the left pane, and then select timthumb.php in the right pane from the list of files. The contents of this file will appear in the center editing area. You’ll need to replace everything (yes, everything) with the code located on this page: http://timthumb.googlecode.com/svn/trunk/timthumb.php – You can do this by copy-pasta – don’t forget to save when you are done.
- Now, that might resolve the problem, but if not, you will need to complete this next step, which is a bit more technical, and it might be best to ask your web designer or someone in the know, to do it for you. Locate the .htaccess file on your server, download a copy and open it up for editing. You will need to add the following 4 lines of code into the file, then save the file and upload/replace the version on your server:
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule&>
We hope that these two steps will help you to resolve your TimThumb problems!
Till next time! *does the special Guru Frog shimmy*
Leave a Comment
popular news STORIES
TimThumb not displaying images? Let’s fix that!
If you've noticed that a number of images aren't displaying correctly ... Read more
George has something new to show you
Hello tadpoles! We're as happy and excited as a dog with two tails, to tell you about the latest theme from the team around the pond. It's called Cohesion, and we like to think of it as "a socially-engaged business theme". Read more
Colour palette basics – Analogous and Monochromatic Colour Schemes
Some people may have a natural knack for knowing and understanding wha... Read more
Valentines Giveaway: Win a copy of our new gorgeous theme – Occasions
Love is in the air, and lucky for you frogs aren't immune to Cupid's m... Read more
Adding a Tweet Box to your site
Both Windows and Mac are integrating social media platforms more and m... Read more
eFrog News Categories
- Code Snippets (8)
- Company News (8)
- Competitions (2)
- Frogology (7)
- Icon Sets (2)
- Plugins (3)
- PondTV (2)
- Security (1)
- SEO (7)
- Specials (3)
- Tips and Tricks (20)
- WordPress Themes (21)
4 months ago
6 months ago
8 months ago

Comments
I had an issue with my gorgeous Occassions theme with featured images, and it turns out it was a TimThumb error. Followed these instructions to the letter, and now it’s all sorted!
Thanks George and Guru Frog – for a ‘techtard’ like me, I usually struggle to sort things out on my own, so always great to get step by step tips on what to do.
Thank you so much for letting us know Rox, it’s always useful to know that our advice is being used successfully.
Hi there. I am working on a site for a client, built on your The Big Deal theme. When I install it on my personal demo domain, everything works fine, but when I install it on the client’s domain, at a different hosting company, I have this problem with the images.
After much debate between me and his hosting company they suggested I look at the TimThumb issue, which I have just did, step by step as per your above post, but the issue still remains.
Do you have any ideas on how to go forward? I you would need details to access the site itself, please contact me directly.
Hi Coenraad…
So we’re getting a couple of these complaints, all of a sudden. Seems that the hosting companies have taken a sudden and uniform dislike to TimThumb…
We read the feedback from the hosting company and it was contradictory in that they say they’ve blocked the script, but you should update the script. So maybe they mean they’ve blocked older versions of the script.
Our short-term (ie NOW) advice is to download the latest TimThumb script from here: https://code.google.com/p/timthumb/
and update it in the theme folder at:
wp-content/themes/the-big-deal-1.2/functions/efrog/lib
Backup the old one first, yes?
We’ll be making some decisions about our themes and our continued use of TimThumb in the near future, and we’ll keep you posted.
Good luck!
Hi George
Thanks for the reply, but replacing the timthumb.php file does not help with the issue at hand.
This is quite a big issue at this stage, so if you could maybe help with some other suggestions it would be great.
By the way, we are running The Big Deal 1.3 and not 1.2.
So, your host is blocking TimThumb completely?
We’re painfully aware that it’s a big issue. Short of holding a gun to the head of your host, any solution to work around your host’s unilateral edict, is going to take significant work, so bear with us, please.
The path was an indicator of where to find the file, not an explicit statement of your version number
It seems like they are blocking it completely yes. Will see if we can get something done on their side as well. I understand that it is not as easy simply taking timthumb out of the theme, so I will then have to look at another solution.
Thanks for the feedback, I really appreciate it.
Hi,
I think this issue with timthumb.php maybe over stated. I had this problem with a few of my website including this one mentioned above. But my host (bluehost) did an excellent job of helping me clear the issue behind the scene. Not only that, they mentioned that it is the issue with the permission of the plugins folders and files. Permission for file is 644 and folder is 755. Painstakingly I did that for all plugins and even the theme files and folders. Viola, the thumbnails all loaded up! Nothing to do with timthumb.php. Hopefully others can confirm. Have a great day.
Sorry, my site is ebooksreviewers.com
Great!! i use permission for file is 644 and folder is 755.
it works. a million thank
Changing permissions worked for me, like Justin said! Thanks!
i used pendulum theme by rascal, and bug error creating thumb.
how fix bug:
-editing last version of timthumb (thumb.php)
-find line 825
- comment this code: $docRoot = @$_SERVER['DOCUMENT_ROOT'];
hey williams
below code is worked for me… thank you soooo muchh.
- comment this code: $docRoot = @$_SERVER['DOCUMENT_ROOT'];
It’s works!! really really thank you for your help..
Our pleasure. Irwan. Glad to help
What if there are several .htaccess files? Which is the one giving trouble to TimThumb?
running “locate .htaccess” gives me
/opt/bitnami/apps/phpmyadmin/htdocs/libraries/.htaccess
/opt/bitnami/apps/phpmyadmin/htdocs/setup/frames/.htaccess
/opt/bitnami/apps/phpmyadmin/htdocs/setup/lib/.htaccess
/opt/bitnami/apps/wordpress/htdocs/.htaccess
Nevermind, it’s pretty obvious with a little bit of staring.
Haha! Yes. Well done
I stared for 2 hours, nothing jumps out. I should just change them all ?
The last one….
Btw, for me it indeed seems to be an htaccess problem, but unfortunately I’m not able to solve it. Making everything less and less secure I’ve come to a point where timthumb works when I give it the src= as a static IP but not with a DNS name… Do you think I’m close to solving the problem?
Working link: http://ec2-54-247-149-100.eu-west-1.compute.amazonaws.com/wordpress/wp-content/themes/bizchoco/thumb.php?src=http://54.247.149.100/wordpress/wp-content/uploads/2012/08/screenshot_mapitakysely.png&h=366&w=960&q=100
Not working http://ec2-54-247-149-100.eu-west-1.compute.amazonaws.com/wordpress/wp-content/themes/bizchoco/thumb.php?src=http://ec2-54-247-149-100.eu-west-1.compute.amazonaws.com/wordpress/wp-content/uploads/2012/08/screenshot_mapitakysely.png&h=366&w=960&q=100
The problem was solved by changing the media file url in the WordPress settings to the one used internally by Amazon EC2.
Yeah. Those EC2 installs can be a bit jiggy. Great servers, sometimes odd challenges to administer.
thanks a lot for info…..$docRoot = @$_SERVER['DOCUMENT_ROOT']; works
Hey, it works! Thanks much
hi man , does not work for me but this one did it .
i added my own url
if(! isset($ALLOWED_SITES)){
$ALLOWED_SITES = array (
‘flickr.com’,
‘staticflickr.com’,
‘picasa.com’,
‘img.youtube.com’,
‘upload.wikimedia.org’,
‘photobucket.com’,
‘imgur.com’,
‘imageshack.us’,
‘tinypic.com’,
‘example.com’,
);
}
highly recommend NOT doing it but it work to
if(! defined(‘ALLOW_ALL_EXTERNAL_SITES’) ) define (‘ALLOW_ALL_EXTERNAL_SITES’, FALSE);
with:
if(! defined(‘ALLOW_ALL_EXTERNAL_SITES’) ) define (‘ALLOW_ALL_EXTERNAL_SITES’, TRUE);
Wow. That last line. Bet you can’t get insurance to cover THAT!
YAY!!!! My images are now showing on my site! I changed all files to 644 and folders to 755 (had already updated timthumb) and now everything is working! Even the fonts I had originally chosen are now showing
thanks all.
Great post! Though as it turned out, I was looking in the wrong direction when it came why my images were not showing up in internet explorer or firefox.
Just in case anyone has a problem similar to my own, if you are running the WP better Security plugin with WordPress, uncheck the filter suspicious query string option and that should fix it.
I am having problem with display of thumbnails.
when i copy the image url it is showing as below
myblogie.com/wp-content/themes/respo/js/timthumb.php?src=&w=200&h=150
could any one help with me.
There’s no image specified in that URL, Goutham. (src=)
You haven’t specified how/what/where you’re having the problem, so all we can say, is the calling URL is malformed.
i am using photoria theme.
Problem is that thumbnail images show only some part of my original picture instead of showing the original image as small.
I read in internet that— No cropping will occur and it will adjust automatically to fit the container size if if we set –zc = 0: Resize to Fit specified dimensions (no cropping)– like timthumb.php?src=atlantis-dock.jpg&zc=0—
But i don’t know how to implement it in TimTHumb.php.
Kindly help me….
I managed to do it myself.
there was a file mytheme_recent_posts.php and in that file there was a code—
<img src="/scripts/timthumb.php?src=&h=250&w=300&zc=0″ width=”300″ height=”250″ alt=”<?php the_title(); ?—
And i changed zc=0 to zc-1 as i required.
Thank You
kevin, thank you very much for this solution. It solved my BIG PROBLEM. I also changed 1 to 0 and got the desired result.
Thanks a lot.
Timthumb doesn;t work for me
Development host is
XAMP, running on WIndows 7
Before I change
if(! defined(‘ALLOW_ALL_EXTERNAL_SITES’) ) define (‘ALLOW_ALL_EXTERNAL_SITES’, TRUE);
I think I will understand what exactly it means, and why it should fix the problem.
What Ayoub was doing was:
1. First set create an array of the external sites which ARE allowed. (Positive control over where the images come from)
2. Second (and correctly NOT recommended) he showed how to change the failsafe line “if allowallsites is NOT defined, then define it as FALSE” to a potentially dangerous “if allowallsites is NOT defined, then define it as TRUE”, so NO control on where the images could come from.
Hope that clears it up
Sweet, thanks for the fix! GREAT!!!
I get this error : [08-Jan-2013 10:29:41 UTC] PHP Warning: file_exists(): open_basedir restriction in effect. File(/home2/rajulida/public_html/PROVA/wp-content/themes/Pluto/timthumb.php/PROVA/wp-content/uploads/2013/01/WM33_thumb.jpg) is not within the allowed path(s): (/home2/rajulida/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home2/rajulida/public_html/PROVA/wp-content/themes/Pluto/timthumb.php on line 859
My themes is Pluto ( from themeforest ) I try :
1. Htaccess change
2. Permission change.
If any have some idea to help me thanks !!!
Jul
you are the man you made my day it worked like charm…thanks man awesome..
You are my hero!!!! Thank you!!!
I’ve WP Better Security installed on my site may be this is causing the problem. Well, I’m using Elegantica Theme, it works fine on my localhost but on the WebHost it is not displaying images. I changed timthumb.php code from the URL mentioned above, changed file permissions etc but nothing happened. Any help ????
You should probably have a word with support at your hosting company. Maybe they’re just blocking TimThumb completely?
Hey,
I’m having issues with the thumbnails not showing on any pictures that are bigger than 1500px. Works great with any other images that are smaller, thumbnails show. How can I fix this issue? Anyone else have this issue.
These solutions don’t work for me . Timthumb worked good in my site since today . I’ve tried all the solutions here but the problem still exists.