ID: 16231
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Scripting Engine problem
Operating System: HP-UX 11.0
PHP Version: 4.1.2
New Comment:
Had some feedback from Scott Kearney from Harvard Uni:-
He also experienced this on an OSF/1 platform. One of his colleagues
traced this to a directory permissions issue.
It appears that if a higher level directory has execute permission but
not read permission, this problem appears.
Changing the higher level directories to permission 555 fixed this.
This is a good workaround but I don't want to compromise my system
security to get an application to work ;-)
Thanks to Scott and his colleagues for their input.
Previous Comments:
------------------------------------------------------------------------
[2002-03-23 09:12:54] [EMAIL PROTECTED]
Summary:
when using include, __FILE__ prepends / to relative paths
History:
Received errors from imp3.0 saying could not find included file. Error
message reported strange path names. See Horde bugs #911 and #912.
Sample Code:
a.php =>
<?php
echo "Calling file ", __FILE__;
echo "<br>included as lib/a.php reports ";
include 'lib/a.php';
echo "<br>included as ./lib/a.php reports ";
include './lib/a.php';
echo "<br>included as /www/yacc/tmp/lib/a.php reports ";
include '/www/yacc/tmp/lib/a.php';
?>
lib/a.php =>
<?php
echo __FILE__;
?>
When I do this, I get
Calling file /www/yacc/tmp/a.php
included as lib/a.php reports /lib/a.php
included as ./lib/a.php reports /lib/a.php
included as /www/yacc/tmp/lib/a.php reports /www/yacc/tmp/lib/a.php
Something keeps putting a leading / on relative paths!
Other Tests:
I created a simple C program to print out the __FILE__ value. When is
compile it with HP's ANSI C compiler it works as expected i.e. the
value is as specified in the include. When I compile with GNU CC
compiler (gcc) the value is "sanitised".
See below
/home/gedl/tmp $ cc -o a a.c ./lib/b.c && echo "The output" && ./a
a.c:
./lib/b.c:
The output
a.c
./lib/b.c
/home/gedl/tmp $ gcc -o a a.c ./lib/b.c && echo "The output" && ./a
The output
a.c
lib/b.c
/home/gedl/tmp $
Essentially the same but not exactly. However both compilers give a
valid answer.
I will continue to work on it but if someone has an answer it would be
appreciated.
Cheers
Ged
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16231&edit=1