TimThumb script returning ‘Could not find the internal image you specified.’

This one has been coming up a bit recently.  Perhaps we’re just getting some new customers using a particular web host that don’t have their servers set up as expected.

In any case, what is happening with the Tim Thumb script that we include with our WordPress themes is that it is returning a “Could not find the internal image you specified.” error when we ask it to render an image that we KNOW is on the filesystem.

The reason for this error is that the server’s DOCUMENT ROOT is not properly defined.  Usually, it’s something like:


The problem with “/usr/local/www/data” being the document root, is that it has NO BEARING on the the actual document root of the user’s web space.  What we’re looking for should be something more like:


So, the solution to the problem is to add a line of code near the top of the Tim Thumb script (in our case, it’s in the “/wp-content/themes/theme_name/includes/user_view/thumb.php”), directly after the configuration comment block that looks like this:

* To edit the configs it is best to create a file called timthumb-config.php
* and define variables you want to customize in there. It will automatically be
* loaded by timthumb. This will save you having to re-edit these variables
* everytime you download a new version

Add this:

define(‘LOCAL_FILE_BASE_DIRECTORY’, ‘actualpathtoyourscript‘);

To find the actualpathtoyourscript, you’ll likely first want to create a script (testing.php) in your main folder of your site that includes the following:

<?php phpinfo(); ?>

And then run it.  You should find, towards the bottom of the script, an entry such as:


Which should give you the path to the root of website (shown in bold):


This entry was posted in Troubleshooting, WordPress Themes and tagged , , . Bookmark the permalink.

Comments are closed.