setup question with open_basedir constraint

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I accidently posted this over at php.general, but I don't generally get
a response over there, and I get a better response here, so I am posing
this question here as well. Hopefully someone has done something like
this and can offer some advice. Thanks in advance.

OK, I need some expert advice on how to do something like this. I have
an open_basedir restriction in place by my host, and I am hosting a few
sites (that will grow in the future).

What I want is something like this.

/mainsite - application files that I am creating would go here.
/site1 - folder for site 1
/site2 - folder for site 2

I would like to have all my application files underneath /mainsite like


Then under /site1 and /site2 I would have symlinks (or php files with
include files in them) that would point to the same file in /mainsite

   config.php - pointing to /mainsite/config.php
   index.php - pointing to /mainsite/config.php

Same for /site2

Problem is I have open_basedir set, so that I can't get to
/mainsite/config.php from /site1/config.php

What are some of my options for setting this up? This would allow me to
essentially have one code base, and then anytime a site (say site1)
wanted a custom config.php file, I could replace the symlink config.php
file with one created just for them, but the rest of the code would
still be from the main code base.

ANyone have any ideas? I have tried to figure out the best way to
accomplish this, and essentially come upon roadblocks.

Would like to hear any ideas or suggestions. Thank you,


Re: setup question with open_basedir constraint

DJ Majestik wrote:

Quoted text here. Click to load it

If they're on the same filesystem, you could use hard links instead - but
it's kinda messy. Anything other than copying the files or changing the
open_basedir or document roots is going to be a bit of kludge.


Re: setup question with open_basedir constraint

Kimmo Laine wrote:
Quoted text here. Click to load it

Unless next_page.php generates PHP, the script with this include will
only get HTML.

Quoted text here. Click to load it


    if (isset($_GET['foo'])) {
      echo '<?php echo $_GET[\'foo\']; ?>';
    } else {
      echo '<?php echo \'Not available\'; ?>';

File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot

Site Timeline