Timthumb – Could not create cache clean timestamp file.


This article describes a solution for a common error message displayed when images are not loading. The error message generally looks something like this: The following error(s) occured: Could not create cache clean timestamp file.

The Cause:

This error generally means there is a security setting on the web server which prevents the TimThumb PHP script from writing to the cache and thus preventing image from loading.

The Solution:

The solution is to modify one of the themes files and adjust the TimThumb settings to play nicely on your web server:

  1. Log into your web server via FTP
  2. Locate a file called timthumb-config.php – this is found within your wordpress installation here: ../wp-content/themes/Sterling/framework/extended/timthumb
  3. Open that file in the code editor of your choice and make the coding change below:
  4. locate this code on line 11:
    define ('FILE_CACHE_DIRECTORY', '');

    And replace it with this:

    define ('FILE_CACHE_DIRECTORY', './cache');
  5. Save the file and upload it to the web server. Images should now be working nicely.