A TimThumb error has occured to show external images link

October 26, 2015 3.7k views
PHP WordPress

getting error when I use timthumb.php to show the images..

A TimThumb error has occured

The following error(s) occured:
You may not fetch images from that site. To enable this site in timthumb, you can either add it to $ALLOWEDSITES and set ALLOWEXTERNAL=true. Or you can set ALLOWALLEXTERNAL_SITES=true, depending on your security needs.

TimThumb version : 2.8.10

1 Answer

Find this string in your timthumb.php:

// external domains that are allowed to be displayed on your website
$allowedSites = array (
    'flickr.com',
    'picasa.com',
    'blogger.com',
    'wordpress.com',
    'img.youtube.com',
);

And add the site you are trying to display images from to the list, then save and relaunch.

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!