Free Web Hosting Forum
Go Back   Free Web Hosting Forum > Website Building > Content Managament Systems
Reload this Page Wordpress | Thumbnail Resizer (timthumb.php) Problem
Closed Thread
 
Thread Tools Display Modes
(#1)
Old
Kaosblade Kaosblade is offline
Junior Member
Kaosblade is on a distinguished road
 
Posts: 17
Join Date: Nov 2009
Unhappy Wordpress | Thumbnail Resizer (timthumb.php) Problem - 02-07-2010, 05:46 PM

Okay, I've got this eBusiness theme on wordpress which automatically resizes pictures in thumbnails using the timthumb.php script.

My website is: www.empirebooks.co.cc

It contains a slider near the top of the page with a thumbnail which uses the script. I've put in an image in the same folder of the script because it didn't work when I put it anywhere else. It still doesn't work.

Here is the script: http://timthumb.googlecode.com/svn/trunk/timthumb.php

If you go to my website or the link below you can see the script generates a broken image. I've followed all the FAQ on timthumb on the net and it still does not work. The only problem left resides with the web host.

http://www.empirebooks.co.cc/wp-cont...192&w=334&zc=1


Can someone tell me what's wrong? Many thanks.
(#2)
Old
xmakina's Avatar
xmakina xmakina is offline
Senior Member
xmakina is on a distinguished road
 
Posts: 854
Join Date: Feb 2009
Location: Oxford, UK
Default 02-07-2010, 06:06 PM

Your hotlink blocker works at least :P

Have you disable the analytics (how is in my signature) as that can cause issues?


Knowledge is power,
Guard it well.

The Big List Of Common Problems & How To Fix Them

Not a staffer, not an admin, just a user who knows how to use a free PHP host when he finds one.

If you found my post helpful, please click the karma button
(#3)
Old
Kaosblade Kaosblade is offline
Junior Member
Kaosblade is on a distinguished road
 
Posts: 17
Join Date: Nov 2009
Default 02-07-2010, 07:11 PM

Yeah I've disabled the analytics and it still doesn't work.

Will my hotlink blocker cause issues?
(#4)
Old
Kaosblade Kaosblade is offline
Junior Member
Kaosblade is on a distinguished road
 
Posts: 17
Join Date: Nov 2009
Default 02-07-2010, 08:02 PM

Here is the timthumb troubleshooting guide on the theme providers website. Here.

There are only two questions left unanswered and they lie with the server or host:

Does your server have the GD library compiled with its version of PHP?

Does your server have mod_security settings that are impeding the scripts functionality?

There is also an error message when I try view the image standalone:

Quote:
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/local/apache/htdocs/www/embed src=) is not within the allowed path(s): (/home/:/usr/lib/php:/tmp) in /home/a5770396/public_html/wp-content/themes/eBusiness/timthumb.php on line 567
Line 567:

PHP Code:
if (file_exists($path $src)) { 
What is wrong?

Last edited by Kaosblade; 02-07-2010 at 08:10 PM.
(#5)
Old
leologger leologger is offline
Junior Member
leologger is on a distinguished road
 
Posts: 1
Join Date: Mar 2010
Send a message via Skype™ to leologger
Default 03-06-2010, 07:57 AM

I just solve this problem with modifying some codes for function "show_cache_file" for my blog. I use "ob_clean" to clean the previous buffer bytes for those consist warning messages, after that I only start to do buffering for those image bytes want to send out and it is working now for my blog http://www.ycoderz.co.cc/blog The modified code of "show_cache_file" as below:
PHP Code:
function show_cache_file ($cache_dir$mime_type) {
    
$cache_file $cache_dir '/' get_cache_file();

    if (
file_exists($cache_file)) {

        
$gmdate_mod gmdate("D, d M Y H:i:s"filemtime($cache_file));

        if(! 
strstr($gmdate_mod"GMT")) {
            
$gmdate_mod .= " GMT";
        }

        if (isset(
$_SERVER["HTTP_IF_MODIFIED_SINCE"])) {

            
// check for updates
            
$if_modified_since preg_replace ("/;.*$/"""$_SERVER["HTTP_IF_MODIFIED_SINCE"]);

            if (
$if_modified_since == $gmdate_mod) {
                
header("HTTP/1.1 304 Not Modified");
                die();
            }

        }

        
$fileSize filesize ($cache_file);
       
        
$buffer file_get_contents($cache_file);

        
ob_get_clean();
        
ob_start();



        
header ('Last-Modified: ' $gmdate_mod);
        
header ('Cache-Control: max-age=9999, must-revalidate');
        
header ('Expires: ' $gmdate_mod);
        
header ('Accept-Ranges: bytes');
        
header ('Content-Type: ' $mime_type);
        
header ('Content-Length: ' $fileSize);

        echo 
$buffer;
        
$sContents ob_get_contents();
        
ob_end_clean();
        echo 
$sContents;

Please let me know if you have a better solution. Thanks.

Last edited by leologger; 03-06-2010 at 02:37 PM.
(#6)
Old
sacccny sacccny is offline
Junior Member
sacccny is on a distinguished road
 
Posts: 1
Join Date: Mar 2010
Thumbs up Problem with timthumb.php & his cache folder - 03-13-2010, 05:52 PM

Thank you very much leologger

Your code solved my problem with 'timthumb.php' & his cache folder.

You are Great Programmer !
Closed Thread

Tags
broken image, picture, resizer, thumbnail, timthumb.php

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com