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
https://forums.phpfreaks.com/topic/112949-interesting-symbolic-link-issue/
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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.