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,

require_once('phpapp.php');

where your 'phpapp.php' lives in directory,

/usr/share/phpapp


Then in the application directory have a config file which includes a host-specific config file:


require_once('../config/phpapp.php');

To my mind, this should fetch '/var/www/host.domain.tld/config/phpapp.php', but it doesn't; it looks for '/usr/share/config/phpapp.php'.

My question is, why? And the supplementary question is, how do I get the behaviour I'm after?

Matthew.

--
0419 242 316 ... (02) 6658 1607
--
Please avoid sending me Word or PowerPoint attachments.
(Save as HTML or RTF)
See http://www.fsf.org/philosophy/no-word-attachments.html
--
"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


--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to