Latest News
TimThumb not displaying images? Let’s fix that!
58 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: – 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:
SecFilterEngine Off
SecFilterScanPOST Off
We hope that these two steps will help you to resolve your TimThumb problems!
Till next time! *does the special Guru Frog shimmy*
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
Adding a Tweet Box to your site
Both Windows and Mac are integrating social media platforms more and m... 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
Create a slick dropdown or flyout menu in minutes
As the amount of content in your site grows, at some stage you'll want... Read more
Hello, lovely tadpoles! Do you remember our post about adding Twit...
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)
- Uncategorized (1)
- WordPress Themes (23)
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:
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! :D
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’];
Great…this solution working on my site. Thanks a lot :)
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—
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.
I’ve tried all, but nothing change. I guess i’d better contact my host provider.
I am having this same issue – I am getting tired of trying now… :(
i just changed domain from mosrri.com to http://www.mosfli.com but now im having problems with thumb.php , thumbnails not showing someone helps?
Thank you for sharing your info. I really appreciate your efforts and I will be
waiting for your further write ups thanks once again.
Thanks for the article (I think) — good to know the URL for the latest version of TimThumb. However, adding the code to my already customized htaccess file produced a server connection error. I had to delete it.
Also, my theme developer recommended changing permissions for thumb.php to 777. I’m hesitant to make anything 777… thoughts?
I had the same result as Bailey, I broke my site. Here’s the error info in case it helps a re-write of this article, which would be nice since this is still a problem.
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at http://www.mysite.com Port 80
Gracias!!!! me ha sido de mucha ayuda esto ya que pude solucionarlo!!
Careful here your code has a “&” that alone is enough to break everybody’s site.
Plus it didn’t solve my issue.
Tinthumb works fine on chrome and firefox, but no thumbnails on IE.
I’m using the latest timthumb.
GoDaddy previewdns.com breaks TimThumb
It seems it gets the first .com instead of the last.
The hack below got it working for me after much head banging:
$this->localImage = $this->getLocalImagePath(str_ireplace(“.previewdns.com”, “”, $this->src));
This code is above the error message:
$this->error(“Could not find the internal image you specified.”);
I have done everything, i have the latest update and checked permissions…
Only the thumbnails don’t appear… if i click on the image the image appears…
the thumbnail link is:
src=”***/timthumb.php?src=&w=176&h=116&zc=1&q=90″
there is no src data, i dont know why it won’t appear. there should be the link to the image but instead of this, there is a “&”?!
the *** is my path i don’t want to show, but its alright.
Alos having an issue. I have followed the instructions above. My issue is the image thumb doesn’t display in a slider. When I look at the link for the image referenced it is a properly formed TimThumb request but I get TimThumb error ” No Image Specified”
Hi,
We used TimThumb for one website.. it work great in our demo server but when we transfer site our demo server to client server, script not work… client server is amazon server ,might be this is problem… i tried your both the solution but my problem not resolved any idea …..
Thanks
Yuvraj R K
Have you ensured that the permissions on the Tim Thumb cache folder are set correctly? That folder may not be writeable by the script. No cache, no workee.
also, many hosts, seeing the risk posed by older out-of-date versions of Tim Thumb, have simply disallowed it from running. Have you spoken to Amazon Support? That’s the other place we’d look.
Leave a Comment
previous post
next post