• 0

WP Plugin - Timthumb


Question

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); ?>&h=<?php echo get_theme_mod('featured_top_left_thumb_height'); ?>&w=<?php echo get_theme_mod('featured_top_left_thumb_width'); ?>&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

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

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.

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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 :)

Link to comment
Share on other sites

  • 0

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! :)

Link to comment
Share on other sites

  • 0

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');?>
[/CODE]

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

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.