ID: 16409
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Filesystem function related
Operating System: Mac OS X 10.1.3
PHP Version: 4.1.2
New Comment:
I'd suggest that if include_once() is given two distinct paths that
just happen to work out the to same file, asking PHP to figure out that
these are the same file is too much trouble.
There are too many tricky cases (like the permissions case documented
here) that are difficult or impossible to get right. On Win32 you
could have UNC and local names pointing to the same file. On Unix you
could hard and soft links pointing to the same file. Sounds like a lot
of trouble :).
Probably the safest bet is to document include_once() and
require_once() as determining file identity strictly by name.
Previous Comments:
------------------------------------------------------------------------
[2002-04-09 07:12:25] [EMAIL PROTECTED]
I installed the update and it still did not work for me. I then looked
where there might be a problem with my installation and finally found,
that the problem occurs, if the webserver does not have read access to
all directories on the path to the script file. I had my home dir set
to rwx--x--x for privacy reasons. Giving read-access for the world,
solved the problem.
I don't know if there is a way to solve this problem, but it is
definitely not nice, that the functions do not work correctly depending
on access rights.
------------------------------------------------------------------------
[2002-04-06 12:31:08] [EMAIL PROTECTED]
I cannot reproduce this on either the Apple-supplied PHP
4.1.2 or a fresh 4.3.0-dev build, running on the default
Apache installation (1.3.22).
realpath() also works as expected.
Can you install Apple's new Security Update, which includes
PHP 4.1.2? If it works for you, we can start narrowing down
why it doesn't work on your custom PHP build.
------------------------------------------------------------------------
[2002-04-03 06:13:57] [EMAIL PROTECTED]
There is a bug with include_once including a file twice, if it is
referenced once with a fully qualified path and once with only the
filename (and the file being in the include path). This script
illustrates what I mean:
include_once('x.php');
include_once('/home/janneck/public_html/x.php');
On my Mac OS X 10.1.3, Apache 1.3.22, PHP 4.1.2 (also: 4.0.6) system,
this results in x.php getting included twice. (It works as expected on
RedHat 7.1, Apache 1.3.22, PHP 4.0.6.)
doing "var_dump(get_included_files());" shows the following:
array(2) { [0]=> string(6) "/x.php" [1]=> string(40)
"/home/janneck/public_html/x.php" }
This might be related to a problem with the "realpath()" function which
does not work correctly but returns "" all the time.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16409&edit=1