How to Fix readfile Problem on TimThumb


Sponsored Links






TimThumb is my favorite Auto Generated Thumbnail code ever seen, simple to use and work great in almost server. But there are readfile function problem on some server in TimThumb auto resized imaged on the fly, this script development by Darren Hoyt and Tweak by Ben Gillbanks, The problem that I currently have is readfile function that disabled by Hosting Server Administrator, they said disabled this function for security reason. So I googling to find out how to fix this problem.

After we googling with several keyword, I got the best solutions from OJAK AJA, and here what we must do. Open your TimThumb script and find this code (around line 496 on version 1.12)

readfile( $cache_file );

Then you need replace readfile function with file_get_contents, Sigiro said, this is the best method, beside file_gets_contents, there are several PHP Functions we can use, such as fpassthru, back to this tricks, to make your TimThumb work, replace code above with this code

$img_data = file_get_contents( $cache_file );
 echo $img_data;

And done, this tricks work like charms in my server client. I hope tricks to fix Readfile Problem on TimThumb is worked on you too

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net

How To Display Twitter counter in Text

Update: Better Code Display Twitter Counter Text using WordPress Api Display Twitter Counter in Text is easily in WordPress with PHP code, all need to do just write down some PHP Script in our wordpress theme, we can write it … Read More

How To Integrate Images Shortcode with TimTumb

Every WordPress Developer has seen that TimTumb is wonderful script, This script is better handle to resize image on the fly and display it what ever size we want and we need. Let's me show you How To Integrate Images … Read More

It’s All About Post Thumbnail

WordPress 2.9 built in new features, like Online Image editor and Post Thumbnail, On this post I will give some information about post that coverage Post Thumbnail, So, if you need to know about Post Thumbnail and add your theme … Read More

Download and Upgrade into WordPress 3.1.1

WordPress Released update on WordPress 3.1.1. Now on version WordPress 3.1.1 there are many enhancement and various bugs fixes. This is some bugs fixes that has already fixed on WordPress 3.1.1 Security hardening to media uploads (r17569)

Fix Readfile Problem on TimThumb Script / WordPress Themes

Did you know, some of our GPL WordPress Theme created using TimThumb to generated better thumbnail for the WordPress Content. The scripts have some problem on read more

Source: http://wpgpl.com/wordpress-tricks/fix-readfile-problem-on-timthumb-script/

How to Fix readfile Problem on TimThumb / WordPress Tricks & Tips

TimThumb is my favorite Auto Generated Thumbnail code ever seen, simple to use and work great in almost server. But there are readfile function problem on some server read more

Source: http://wptricks.net/how-to-fix-readfile-problem-on-timthumb/

How To Fix TimThumb Script Vulnerability / WordPress Themes

Fix Readfile Problem on TimThumb Script. Did you know, some of our GPL WordPress Theme created using TimThumb to generated better thumbnail for the WordPress Content. read more

Source: http://wpgpl.com/wordpress-tricks/how-to-fix-timthumb-script-vulnerability/

WordPress › Support » I want TimThumb OUT - How do I remove it

I don't want to fix Timthumb. I just want it out. I'd GREATLY appreciate help works like charms in my server client. I hope tricks to fix Readfile Problem on TimThumb is read more

Source: http://wordpress.org/support/topic/i-want-timthumb-out-how-do-i-remove-it-and-return-to-default

remove query strings from static resources timthumb - WordPress

Very Useful 65 Wordpress Hacks | Stevelizardi.com on How to Fix readfile Problem on TimThumb; WordPress Code Snippets and Detailed Tutorials | eXpand yOur cReativity on How read more

Source: http://wptricks.net/archives/remove-query-strings-from-static-resources-timthumb?amp


16 Responses to How to Fix readfile Problem on TimThumb

  1. Pingback: Very Useful 65 Wordpress Hacks | Design your way

  2. Pingback: How To Display Twitter counter in Text # WordPress Tricks & Tips

  3. Pingback: How To Integrate Images Shortcode with TimTumb # WordPress Tricks & Tips

  4. Jonathan says:

    Maybe it was a CHMOD permissions issue. cache / temp and timthumb.php needed to be 755 instead of 777.

    http://www.jeffkee.com/timthumb-php-404-apache-php-security-chmod-755-777-error-lo/

  5. François says:

    My TimThumb.php file stop (suddenly) to work this morning with this error “PHP Warning: readfile() has been disabled for security reasons in /path/to/timthumb.php on line 484″

    But with your trick everything is back to life now !

    Thanks.

  6. jehzlau says:

    still didn’t work for me.. huhuhu.. I don’t know what to do now. wah!

  7. wilbur says:

    I use Headway theme and wordpress 3.01.1 and i cant see the small images i get 404 406 errors

  8. Pingback: Wordpress hacks and tricks | Wordpress Theme Designing, Blog Optimization, Wordpress Videos

  9. trismile says:

    Thanks,

    This advice solved my problem . :)

  10. Qasim Yad says:

    well done!!!
    you rock bro. i have solve my problem.
    may you get satisfied life ………….

  11. Ansen says:

    Hello Wp Tricks,
    I got problem with my shared hosting hostgator, they ask me to solve the timthumb on my freshlife theme, my blog visitor getting 30000/day so the hosting ask me to solve that because my blog consumption too many resource make the server down, they said.
    Bellow the twarning from my server:

    After reviewing the documentation in the opening reply, the issue appears to be centered around your theme. Specifically the timthumb feature which may be dynamically resizing your images. Dynamically resizing images not only puts load on the server, but it also slows down the load times for the site itself. In order to resolve this issue I highly recommend updating your wordpress to use a less resource intensive theme while you address freshlife

    A common solution would be to resize images before uploading them to your blog. Or contact the theme creator for any caching or optimizations which may be available for the theme.

    Please reply with the ip address shown at the url: http://www.hostgator.com/ip.shtml and include any further modifications which may have been made.

    If you have any questions or concerns, please don’t hesitate to contact us. We are more than happy to assist you.

    Thank you for helping me !

  12. Pingback: Very Useful 65 Wordpress Hacks | Stevelizardi.com

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>