Sign in to follow this  
Followers 0

WP Plugin - Timthumb

6 posts in this topic

Posted

I'm trying to help a friend of mine. He's having issues with a famous Wordpress plugin called TimThumb.

So, here's the case...

He's using the correct custom attribute on the Wordpress to show the thumbnails on front page, which is "thumb". But when we try to view the image file the browser returns the following error:

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/lesbos/www/wp-content/uploads/2010/02/DSC01447.jpg) is not within the allowed path(s): (/home/viciotech/:/tmp:/usr/local/lib/php:./) in /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php on line 661

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/lesbos/www/viciotech/wp-content/uploads/2010/02/DSC01447.jpg) is not within the allowed path(s): (/home/viciotech/:/tmp:/usr/local/lib/php:./) in /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php on line 670

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/lesbos/www/viciotech/migrateste/wp-content/uploads/2010/02/DSC01447.jpg) is not within the allowed path(s): (/home/viciotech/:/tmp:/usr/local/lib/php:./) in /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php on line 670

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/lesbos/www/viciotech/migrateste/wp-content/wp-content/uploads/2010/02/DSC01447.jpg) is not within the allowed path(s): (/home/viciotech/:/tmp:/usr/local/lib/php:./) in /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php on line 670

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/lesbos/www/viciotech/migrateste/wp-content/themes/wp-content/uploads/2010/02/DSC01447.jpg) is not within the allowed path(s): (/home/viciotech/:/tmp:/usr/local/lib/php:./) in /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php on line 670

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/lesbos/www/viciotech/migrateste/wp-content/themes/streamline_30/wp-content/uploads/2010/02/DSC01447.jpg) is not within the allowed path(s): (/home/viciotech/:/tmp:/usr/local/lib/php:./) in /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php on line 670

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/lesbos/www/viciotech/migrateste/wp-content/themes/streamline_30/tools/wp-content/uploads/2010/02/DSC01447.jpg) is not within the allowed path(s): (/home/viciotech/:/tmp:/usr/local/lib/php:./) in /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php on line 670

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/lesbos/www/viciotech/migrateste/wp-content/themes/streamline_30/tools/timthumb.php/wp-content/uploads/2010/02/DSC01447.jpg) is not within the allowed path(s): (/home/viciotech/:/tmp:/usr/local/lib/php:./) in /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php on line 670

Warning: Cannot modify header information - headers already sent by (output started at /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php:661) in /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php on line 489

Warning: Cannot modify header information - headers already sent by (output started at /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php:661) in /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php on line 490

Warning: Cannot modify header information - headers already sent by (output started at /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php:661) in /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php on line 491

Warning: Cannot modify header information - headers already sent by (output started at /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php:661) in /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php on line 492

Warning: Cannot modify header information - headers already sent by (output started at /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php:661) in /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php on line 493

Warning: Cannot modify header information - headers already sent by (output started at /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php:661) in /home/viciotech/www/migrateste/wp-content/themes/streamline_30/tools/timthumb.php on line 494

Here's the part of the code he's using to publish these thumbnails.

<?php if( get_post_meta($post->ID, "thumb", true) ): ?>

				<a href="<?php the_permalink() ?>" rel="bookmark"><img class="thumb" src="<?php bloginfo('template_directory'); ?>/tools/timthumb.php?src=<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>&amp;h=<?php echo get_theme_mod('featured_top_left_thumb_height'); ?>&amp;w=<?php echo get_theme_mod('featured_top_left_thumb_width'); ?>&amp;zc=1" alt="<?php the_title(); ?>" /></a>

I've read about folders and files permissions, but the script and cache folders are set to 777 and have disabled mod_security on Apache too.

Has anyone experienced this problem when implementing TimThumb?

EDIT: Sorry, forgot the image link

Share this post


Link to post
Share on other sites

Posted

Guys, just figure it out how to solve the problem after googling for some hours.

Use the "Post Thumbnail Images" feature of WordPress. Didn't know about it because it's hidden. :shiftyninja:

More info.

Share this post


Link to post
Share on other sites

Posted

You're lucky cause the WordPress Post Thumbnail images feature is new. As much as I prefer the TimThumb for the automated solution + auto resize, it's always better to use a native one. TimThumb is also a CPU hog, even though it has its own caching mechanism

1 person likes this

Share this post


Link to post
Share on other sites

Posted

I know you said you already resolved this.. but open_basedir restriction in effect just means that open_basedir is enabled which prevents using from running scripts outside of their own directory (eg: /home/username). Prevents any malicious intent on the rest of the server and just locks you to your own account.

Also, you should be using the following for your timthumb URL:

<img src="<?php bloginfo('template_directory'); ?>/tools/timthumb.php?src=<?php bloginfo('url');?>/wp-content/uploads/<?php echo get_post_meta($post->ID, "large", true); ?>&h=150&w=150&zc=1" alt="" />
I'm not sure what your theme actually has though so you might already have that or you might not.. But I'm guessing you don't namely because the URL that you're trying to use for your image is just "wp-content/uploads." openbase_dir is picking that up as trying to access a directory outside of your own thus why that pops up. Just add in:
<?php bloginfo('url');?>

Where you have your src=/wp-content.

Even if you're not going to use timthumb anymore at least you know why it wasn't working :)

Share this post


Link to post
Share on other sites

Posted

Hi Cupcakes,

I apologize for bringing up a really old topic but I need additional information on what you mean by...

Just add in:

<?php bloginfo('url');?>

Where you have your src=/wp-content.

I am having this same problem and it's driving me batty!

Thank you! :)

Share this post


Link to post
Share on other sites

Posted

Hi Cupcakes,

I apologize for bringing up a really old topic but I need additional information on what you mean by...

Just add in:

<?php bloginfo('url');?>

Where you have your src=/wp-content.

I am having this same problem and it's driving me batty!

Thank you! :)


<?php bloginfo('url');?>

It calls the url of the wordpress install. so say you installed wordpress to your root folder it would return www.example.com.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.