note 46774 deleted from function.include by sean
| From: | sean@php.net | Date: | Sat, 23 Oct 2004 03:08:37 +0000 |
| Subject: | note 46774 deleted from function.include by sean | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-78975@lists.php.net to get a copy of this message | ||
Note Submitter: guy at lifetoward dot net
----
It appears that as require and include search for the file to include, they have a strange behavior
as regards symlinks. Consider the following:
/thisdir/myprogram.php -> /otherdir/myprogram.php
/thisdir/mycommon.php
And as you are running under a webserver, it's accessing myprogram.php as
/thisdir/myprogram.php. Seems normal.
Now, inside myprogram.php you have:
require_once('mycommon.php');
This will NOT find /thisdir/mycommon.php ! It will instead apparently search /otherdir as
myprogram.php's current directory and come up empty, causing require to fail. I proved this by
finding that if /otherdir/mycommon.php exists, it will get included instead.
This borders on a bug for me. It means that I can't have app instances which are made of
symlinks to a base set of php programs but having separate configuration variables as might be
included in a require statement like above. I am still looking for ways around this, but I thought
in the meantime I'd mention it.
----
Reason: useless note