Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

TimThumb on MultiSite: "Could not create the index.html file" WordPress

  • SOLVED

1. Visit this site: http://nord.centres-sociaux.fr/

2. None of the thumbnails are working

3. Visit one of the thumbs, like this one:

http://nord.centres-sociaux.fr/wp-content/themes/premiumnews/functions/thumb.php?src=/blogs.dir/2633/files/2012/07/Sans-titre2-Copie.png&w=100&h=57&zc=1&q=90

4. The error: "Could not create the index.html file"

5. Question: where is the cache folder for timthumb on a multisite?

6. A lead? I read this article, but I'm not sure if it's associated with my cache folder issue: http://www.magpress.com/blog/how-to-make-timthumb-work-with-single-site-and-multisite

Answers (7)

2012-08-30

Francisco Javier Carazo Gil answers:

Hi,

I have experience in this problem using WordPress network and MU. To solve it:
1. Download timthumb from his website: http://code.google.com/p/timthumb/
2. Look for this:
// -------------------------------------------------------------
// -------------- STOP EDITING CONFIGURATION HERE --------------
// -------------------------------------------------------------

3. Below this add:
// FIX MU 1
require( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' );

4. So it will be now:
// -------------------------------------------------------------
// -------------- STOP EDITING CONFIGURATION HERE --------------
// -------------------------------------------------------------

// FIX Multisitio 1 de 2
require( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' );

timthumb::start();

5. Now you have to find this:
protected function calcDocRoot(){
$docRoot = @$_SERVER['DOCUMENT_ROOT'];

6. And below add:
// FIX MU 2
if (is_multisite())
{
global $blog_id;
if (isset($blog_id) && $blog_id > 0)
{
$docRoot .= '/wp-content/blogs.dir/' . $blog_id . '/';
}
}

7. So it will be now:
protected function calcDocRoot(){
$docRoot = @$_SERVER['DOCUMENT_ROOT'];

/// Fix Multisitio 2 de 2
if (is_multisite())
{
global $blog_id;
if (isset($blog_id) && $blog_id > 0)
{
$docRoot .= '/wp-content/blogs.dir/' . $blog_id . '/';
}
}

8. Save the file modified and then upload it to your theme (wp-content/themes/your-current-theme)

If have further questions tell me.


Kim Gjerstad comments:

If I give you access, can you fix it for me?


Francisco Javier Carazo Gil comments:

Please, send me login details via PM.

2012-08-29

Michael Caputo answers:

You need to log into your FTP and create a blank file in your cache folder (I don't know where this is located on your server). That should fix it.


Michael Caputo comments:

If you can provide me with your FTP credentials, I can do this for you.


Kim Gjerstad comments:

I really can't give the FTP!


Michael Caputo comments:

Rashad Aliyev - Understood, however, it doesn't sound like he knows where the cache folder is, so I can't give him the exact url to add the file to. Just offering to resolve his issue.

2012-08-29

Rashad Aliyev answers:

It's got only 1 cache folder.

To resolve this issue you’ll have to delete all files that exists inside the cache directory including “index.html” and/or “timthumb_cacheLastCleanTime.touch” file too.


Rashad Aliyev comments:

Michael Caputo if Kim Gjerstad want to give ftp to anybody for solving his problem then write like that. However it's not fair, and it's not answer of the question;)


Kim Gjerstad comments:

But where's the cache folder? I couldn't find one in the theme's folder or in the site's /upload folder.

2012-08-29

Abdelhadi Touil answers:

Hi.
I agree with Rashad Aliyev, just delete all files in your timthumb cache folder via FTP program (I think it's in functions folder in your theme folder), and the problem will be fixed. If not try to make the cache folder writable (chmode = 777).

2012-08-29

Luis Abarca answers:

Set folder to 755 or 775 (just to try) it dependes of your configuration.

chmod 755 cache

Create index.html in cache folder or


cd cache
chmod 644 index.html


2012-08-29

Arnav Joy answers:

please read this useful article of timbthumb for multisite

http://www.binarymoon.co.uk/2009/10/timthumb-wordpress-mu/

2012-08-31

Gabriel Reguly answers:

Hi Kim,

Yes, you should apply the fixes you see at [[LINK href="http://www.magpress.com/blog/how-to-make-timthumb-work-with-single-site-and-multisite"]]http://www.magpress.com/blog/how-to-make-timthumb-work-with-single-site-and-multisite[[/LINK]]

The cache folder depends on the blog you are seeing, <em>wp-content/blogs.dir/BLOG_ID/files</em>


Regards,
Gabriel