Jump to content



Photo

WP Plugin - Timthumb


  • Please log in to reply
5 replies to this topic

#1 bruNo_

bruNo_

    "Who are you and why should I care?"

  • Joined: 08-May 07
  • Location: São Paulo, Brazil

Posted 15 February 2010 - 18:25

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

http://migrateste.viciotech.com.br/wp-content/themes/streamline_30/tools/timthumb.php?src=wp-content/uploads/2010/02/DSC01447.jpg&h=150&w=150&zc=1




#2 OP bruNo_

bruNo_

    "Who are you and why should I care?"

  • Joined: 08-May 07
  • Location: São Paulo, Brazil

Posted 15 February 2010 - 20:18

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.

#3 :: Lyon ::

:: Lyon ::

    Neowinian Senior

  • Joined: 03-May 03
  • Location: Melbourne, Australia

Posted 15 February 2010 - 22:25

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

#4 +Cupcakes

Cupcakes

    #pugs { display: block; }

  • Joined: 12-May 09
  • Location: Chicago, IL

Posted 26 February 2010 - 04:40

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

#5 GreenMtnGal

GreenMtnGal

    Resident One Post Wonder

  • Joined: 17-October 11

Posted 17 October 2011 - 00:17

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

#6 the better twin

the better twin

    Neowinian Senior

  • Tech Issues Solved: 2
  • Joined: 26-January 10
  • OS: Win 8
  • Phone: Nokia Lumia

Posted 17 October 2011 - 14:02

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.



Click here to login or here to register to remove this ad, it's free!