Hello - Love the Boost! I just installed it and it is blazingly fast.

However, I am having a wee problem. When an anon user clicks on a taxonomy page on the menu (not sure if I am describing that right... it's when you have taxonomies for stories, and you click on a link on the menu that takes you to something that looks like the frontpage, but only shows stories of that category) I get this error:

symlink(): open_basedir restriction in effect. 
File(/var/www/vhosts/piggington.com/taxonomy/term/16.html) is not within the allowed path(s):
(/var/www/vhosts/piggington.com/httpdocs:/tmp) in 
/var/www/vhosts/piggington.com/httpdocs/modules/boost/boost.helpers.inc on line 83.

Now I am not too bright, but I think the problem is that it's looking one directory up from my basedir. My basedir is:

/var/www/vhosts/piggington.com/httpdocs

whereas it is trying to hit:

/var/www/vhosts/piggington.com/taxonomy/term/16.html

(note that it's missing the "httpdocs" directory).

BTW the page serves up correctly, so it is not a huge deal, but I always get a little scared when i see those red "php" errors in the logs. :-)

Please let me know what other info I can provide.

And thanks for the great module...

Rich

Comments

Arto’s picture

Title: open_basedir error on taxonomy pages » Invalid symlinks being generated
Assigned: Unassigned » Arto
Status: Active » Fixed

The logic for the symlinking was a bit buggy in older versions, but I believe this problem should not occur with the latest development snapshot of Boost.

satos’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev
Status: Fixed » Active

Well, i'v downloaded new build but still...:

symlink() [<a href='function.symlink'>function.symlink</a>]: open_basedir restriction in effect. File(/home/virtwww/node/1711.html) is not within the allowed path(s): (/tmp:/home/virtwww/w_tfortest_3b1af487) in /home/virtwww/w_tfortest_3b1af487/http/modules/boost/boost.helpers.inc on line 83.

Arto’s picture

Title: Invalid symlinks being generated » Invalid symlinks being generated with open_basedir in effect

Something in the cache directory path computation looks to be going wrong, presumably due to open_basedir. Try specifying the full file system path for the cache directory in your configuration.

Jeroen Coumans’s picture

I've got the same problem, except with different URL's of course. Caching seems to work for most pages, but strangely not all. For example, I can see my homepage is cached (http://jeroencoumans.nl) but not my "elsewhere" pages (e.g. http://jeroencoumans.nl/elsewhere/2007/10/07/anti-patterns-talk). In the logs, the following message appears:

boost: Unable to create symlink: /home/jeroencoumans.nl/public_html/cache/jeroencoumans.nl/0/elsewhere/2007/10/07/anti-patterns-talk.html to /home/jeroencoumans.nl/public_html/cache/jeroencoumans.nl/0/node/3092.html

php: symlink() [function.symlink]: open_basedir restriction in effect. File(/home/node/3092.html) is not within the allowed path(s): (/home/jeroencoumans.nl/:/tmp:/usr/local/lib/php/) in /home/jeroencoumans.nl/public_html/sites/all/modules/boost/boost.helpers.inc on line 83.

Folder permissions are all writeable for the webserver. Setting the cache directory absolutely to /home/jeroencoumans.nl/public_html/cache prefixes this path to the docroot, making it appear twice.

reikiman’s picture

Version: 5.x-1.x-dev » 5.x-1.0

I have the same problem.

I've installed it on my sites hosted on dreamhost and this behaviour doesn't happen there. Note that dreamhost uses PHP5.

The server where this happens has PHP4 and the error is exactly like the ones listed above. I'm using 5.x-1.0 from Sep 30, 2007.

I had to chmod the cache directory to 777 due to a different problem in the function for PHP4 compatibility.

Based on the above suggestions I entered the full path for the cache directory... and got this error (it's in that same PHP4 compatibility module) which indicates some place in the module still isn't specifying the correct pathname.

warning: fopen(/var/www/vhosts/www.7gen.com/httpdocs//var/www/vhosts/www.7gen.com/httpdocs/cache/www.7gen.com/0/view/items/efficient-cooling.html): failed to open stream: No such file or directory in /var/www/vhosts/www.7gen.com/httpdocs/modules/boost/boost.helpers.inc on line 91.
reikiman’s picture

Version: 5.x-1.0 » 5.x-1.x-dev

Oops.. shouldn't have changed version?

deverman’s picture

I also am having the same problem with the sym links and made a separate post before seeing this one:

http://drupal.org/node/200658

The problem is in this function _boost_symlink and I ended just commenting out this if statement below and things are working now.

/**
 * Creates a symbolic link using a computed relative path where possible.
 */
function _boost_symlink($target, $link) {
  if (!file_exists($target) || !file_exists(dirname($link)))
    return FALSE;

	
  $target = explode('/', $target);
  $link = explode('/', $link);

// code changed by brent to just create a straight link instead of realiteve link 12/15
  // Only bother creating a relative link if the paths are in the same
  // top-level directory; otherwise just symlink to the absolute path.
//   if ($target[1] == $link[1]) {
//     // Remove the common path prefix
//     $cwd = array();
//     while (count($target) > 0 && count($link) > 0 && reset($target) == reset($link)) {
//       $cwd[] = array_shift($target);
//       array_shift($link);
//     }
//     // Compute the required relative path
//     if (count($link) > 1)
//       $target = array_merge(array_fill(0, count($link) - 1, '..'), $target);
//     $link = array_merge($cwd, $link);
//   }

  return symlink(implode('/', $target), implode('/', $link));
}

moshe weitzman’s picture

we are likely getting rid of symlinks soon: http://drupal.org/node/174380

liam mcdermott’s picture

I can confirm this, using the latest dev version of Boost on D5 with PHP4 (haven't tested with PHP5 yet).

Thanks deverman, those instructions seem to work perfectly. Maybe deverman's changes could be committed to the dev version whilst we're waiting for symlinks to be removed altogether?

alex72rm’s picture

Hi,

I have the latest "Boost" dev version installed on a Linux platform.

Anyway the same error arise from watchdog:

Unable to create symlink: /var/www/vhosts/nuovofiscooggi.it/httpdocs/cache/www.nuovofiscooggi.it/0/giurisprudenza/articolo/vita-breve-gli-appelli-f... to /var/www/vhosts/nuovofiscooggi.it/httpdocs/cache/www.nuovofiscooggi.it/0/node/4327.html

symlink() [function.symlink]: open_basedir restriction in effect. File(/var/www/vhosts/nuovofiscooggi.it/taxonomy/term/1.html) is not within the allowed path(s): (/var/www/vhosts/nuovofiscooggi.it/httpdocs:/tmp:/usr:/bin) in /var/www/vhosts/nuovofiscooggi.it/httpdocs/sites/all/modules/boost/boost.helpers.inc nella riga 83.

I used the original boosted.txt to replace .htaccess.

Maybe it's always a problem of relative path... but how can resolve it?

Alessandro

alex72rm’s picture

Status: Active » Needs work

Hi,

I solved immediately with #7 (thanks a lot deverman!!!)

I'm asking myself why the patch hasn't been inserted into the dev version (one year passed since deverman's post).

Alessandro

wwwoliondorcom’s picture

Hello,

I just had the same problem and copied the #7 code (thanks!).

Will tell you later if it works.

Is there anything else that I should do ?

Thanks for all.

ps: i am hosted in dreamhost ps

wwwoliondorcom’s picture

Just after starting to use #7 I got the same error again so I disabled boost.

Any solution ?

mikeytown2’s picture

mikeytown2’s picture

Assigned: Arto » Unassigned
mikeytown2’s picture

Status: Needs work » Closed (duplicate)

This issue removes all symlinks; merging all symlink issues into this one.
#174380: Remove symlink creation. Let each path have own file