Jump to content

Interesting symbolic link issue


Pioden

Recommended Posts

I need some help with a problem.

 

Lets say I have 5 users. They all have their own home directories BUT they need to share common files which are stored by user 6 ... Easy. Symbolic link from each user to the relevant directory owned by user 6. Tested and working :-)

 

Where it all goes wrong is the next step. Every user has their own config.php file stored in their home directory. The common files need to access each users individual config file in order to access database settings. But how? ../config.php or similar simply references the files in user 6'd home directory.

 

Can you see what I'm getting at? I need a way to php to dynamically reference the config file in the correct home directory. All suggestions welcome - this one is doing my head in!!!

Link to comment
Share on other sites

The $_ENV array will be of little use to use in this case because apache runs under its own user.

 

The common files need to access each users individual config file in order to access database settings. But how?

 

Sounds like you are creating some type of framework (the shared files) which can run multiple sites (based on settings in a users $HOME directory). How are you determining which user is accessing the site?

 

Eg;

 

My framework works much the same, the core of it is stored within /usr/share/php5, while each site is within /var/www/sitename. However, each of my sites runs under a different vhost so it is simple to find out which config file (/var/www/sitename/etc/config.php) to execute based on the domain name within the url.

 

Maybe you could do something similar?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.