SLUG Mailing List Archives
Re: [SLUG] Symlinks and PHP4
- To: Matthew Davidson <mdavids@xxxxxxxxxx>
- Subject: Re: [SLUG] Symlinks and PHP4
- From: O Plameras <oscarp@xxxxxxxxxxx>
- Date: Thu, 02 Sep 2004 19:08:20 +1000
- Cc: slug@xxxxxxxxxxx
- User-agent: Mozilla Thunderbird 0.7.3 (X11/20040803)
Matthew Davidson wrote:
Here's a really elementary question about symlinks that's taxing my
limited mental capacity:
I want to write some php apps to be made available to a number of
virtual hosts on a web server. It seems to me that you should be able
to put the apps themselves somewhere outside the web root, for
instance '/usr/share/phpapp', and have a symlink from the virtual
hosts web root, i.e.:
/var/www/host.domain.tld/phpapp => /usr/share/phpapp
You rename directories for httpd access using the 'Alias Directory'
command. Renaming with 'ln -s' does not work.
But there is a conventional way to access PHP modules or include
files. This is done by declaring the directory from where to get the PHP
scripts to be included in your /etc/php.ini. Look for a line that says,
include_path = "/path1;,/path2; etc.............."
It will look like so,
include_path = ".;/usr/share/phpapp"
in your case.
Then, you can say,
where your 'phpapp.php' lives in directory,
Then in the application directory have a config file which includes a
host-specific config file:
To my mind, this should fetch
'/var/www/host.domain.tld/config/phpapp.php', but it doesn't; it looks
My question is, why? And the supplementary question is, how do I get
the behaviour I'm after?
0419 242 316 ... (02) 6658 1607
Please avoid sending me Word or PowerPoint attachments.
(Save as HTML or RTF)
"Our enemies are innovative and resourceful, and so are we.
They never stop thinking about new ways to harm our people
and our country, and neither do we."
-- George W. Bush