Re: Difficulty navigating symlinks

From: Date: Wed, 22 Oct 2008 17:20:46 +0000
Subject: Re: Difficulty navigating symlinks
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-282264@lists.php.net to get a copy of this message
Jim Lucas wrote:
Seth Foss wrote:
Hi everyone, I am trying to run multiple sites on the same server, that have mostly identical code - a pre-built application. Anyway, I would like to save disk space by specifying independent configuration files for each site, then using symbolic links to access the rest of the code for the application. I have managed to configure apache so one such directory is accessed via a symlink, which is ok. However, a file within the linked directory attempts to include the configuration file (../config.php) from the actual parent directory instead of the directory containing the symlink. Is there any way to configure apache or php to trace back the symlink when using '..', or can that only go one direction? Thanks, Seth
    
You can set the include path for your code to include the parent directory from where the symlink is and then remove the ../ part of the call. Jim,
I had considered that, but I plan to have multiple directories following symlinks to the same place. For example, /var/www/site1 has a config.php and a symlink to var/www/universal/app while /var/www/site2 has a different config.php and a symlink to var/www/universal/app var/www/universal/app has an index.php with include(../config.php) that needs the config from the site that is using it (i.e., sometimes site1, sometimes site2) Does that make sense? Or did I misunderstand your suggestion? Thanks, Seth

« previous php.general (#282264) next »