SLUG Mailing List Archives
Re: [SLUG] Symlinks and PHP4
- To: slug@xxxxxxxxxxx
- Subject: Re: [SLUG] Symlinks and PHP4
- From: Matthew Davidson <mdavids@xxxxxxxxxx>
- Date: Fri, 03 Sep 2004 00:29:19 +1000
- User-agent: Mozilla Thunderbird 0.7.1 (X11/20040715)
... PHP opens files relative to the currently running script's
location. If you are running /usr/share/phpapp/myfile.php then
require_once('a.php') will require /usr/share/phpapp/a.php, regardless
Hmm. I _almost_ get it. You seem to be saying that internally PHP has
some kind of "where the hell am I?" function that returns the location
of the currently running script, rather than simply taking the file name
which you used to invoke the script (in the case of symlinks). That
seems counter-intuitive to me.
And the supplementary question is, how do I get the behaviour I'm after?
require_once($_SERVER["DOCUMENT_ROOT"] . "/config/phpapp.php");
That sounds like the simplest of the options so far.
Thanks to everybody who had a suggestion. They are all filed away for
You may have more luck getting answers to PHP questions at syd::php
I've been trying to avoid considering myself a PHP programmer, feeling
that I ought, on some vaguely-defined moral grounds, to prefer the
original "P" language, which I have been forgetting and re-learning for
years now. But I'm a very reluctant and lazy programmer and damn it,
the dark side is easier and more seductive!
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