ID: 49039
Comment by: 1minus1 at gmail dot com
Reported By: sant9442 at gmail dot com
Status: Feedback
Bug Type: CGI related
Operating System: win32 only - Windows
PHP Version: 5.3.0
Assigned To: pajoye
New Comment:
Hi!
I've just upgraded from PHP 5.2.10 to PHP 5.3.0 and had a problem
similar to the discussed one: every attempt to load (with Apache) any
php web page failed with the following error:
Warning: Unknown: failed to open stream: No such file or directory in
Unknown on line 0
Fatal error: Unknown: Failed opening required 'C:/usr/www/test.php'
(include_path='.;C:\php5\pear') in Unknown on line 0
After a while I happened to understand that the problem is related to
symbolic links (directory junctions). On my system (Win XP SP3) the
"C:\usr" folder is a junction to "D:\usr". The easiest way to
reproduce this bug is by calling the CLI PHP interpreter.
C:\>type c:\usr\temp\test.php
<?="OK"?>
C:\>php c:\usr\temp\test.php
Could not open input file: c:\usr\temp\test.php
C:\>php d:\usr\temp\test.php
OK
--- 5 minutes later ---
Hmmm... I tried to reproduce the problem on some other "artificially
created" folders and symlincs, and I happened to be unable to do so!
And what is more, when I removed the "c:\usr" junction and re-created
it - the problem (with Apache and the example above) disapeared! I
don't know now how to interpret the problem, maybe that was a "bad
link" (in some way), but the fact is: it *happened* and I've clearly
seen it happening several times with 5.3 and not happening with 5.2.
At least I hope my report can help some googling "poor guys" like me
to to get a clue on what is happening. :)
Previous Comments:
------------------------------------------------------------------------
[2009-08-10 15:18:09] pajoye@php.net
Which windows version do you use?
------------------------------------------------------------------------
[2009-08-10 15:17:13] pajoye@php.net
Hi,
I was not able to reproduce this problem using:
F:\wc63>dir
<JUNCTION> http [F:\wc63\http-1234]
<DIR> http-1234
and the following call:
..\obj\Debug_TS\php-cgi.exe f:\wc63\http\pwe\t.php
X-Powered-By: PHP/5.3.1-dev
Content-type: text/html
included
F:\wc63\http-1234\pwe
script being: <?php echo "included\n"; print_r(getcwd());
Are you sure about the last line of the processmonitor log?
G:\files\php\php5-3-1-snapshot\pwephpinfo.php NAME NOT FOUND
As it is not only missing a back slash but the path itself is
completely wrong. It should have been:
D:\wc63\http\pwe\phpinfo.php
If you still get the same (wrong) results, please give me a way to
reproduce it. Using one directory tree (D:\wc63\http with
D:\wc63\http-1234 for example) and how exactly you call php.
------------------------------------------------------------------------
[2009-07-23 23:15:20] sant9442 at gmail dot com
Sure thing!
Btw, take a look at the last line for the 5.3 Process Monitor dump,
where it shows:
G:\files\php\php5-3-1-snapshot\pwephpinfo.php NAME NOT FOUND
Notice that it is missing a slash, so it seems its pointer movement is
off by one somewhere in the code, and I think this might be part of the
GPF that might occur as mentioned in bug #49040.
Thanks
------------------------------------------------------------------------
[2009-07-23 23:02:57] pajoye@php.net
Thanks for the clear explanation :)
Ok, so it may be related to a bug with junctions and symlink in 5.3. I
will check it while working in the other related bugs (august, not
before :).
------------------------------------------------------------------------
[2009-07-23 23:02:25] sant9442 at gmail dot com
Small followup. I used SysInterna's ProcessMonitor and what I found,
that PHP 5.3 has a REVERSE ORDER LOOKUP of symbol link vs PHP 5.2.6
For example, for PHP 5.2.6, Process Monitor shows:
IRP_MJ_CREATE D:\ SUCCESS
IRP_MJ_DIRECTORY_CONTROL D:\wc63 SUCCESS
IRP_MJ_CLEANUP D:\ SUCCESS
IRP_MJ_CLOSE D:\ SUCCESS
IRP_MJ_CREATE D:\wc63 SUCCESS
IRP_MJ_DIRECTORY_CONTROL D:\wc63\http SUCCESS
IRP_MJ_CLEANUP D:\wc63 SUCCESS
IRP_MJ_CLOSE D:\wc63 SUCCESS
IRP_MJ_CREATE D:\wc63\http REPARSE
IRP_MJ_CREATE D:\wc63\http-4529 SUCCESS
IRP_MJ_DIRECTORY_CONTROL D:\wc63\http-4529\pwe SUCCESS
IRP_MJ_CLEANUP D:\wc63\http-4529 SUCCESS
IRP_MJ_CLOSE D:\wc63\http-4529 SUCCESS
IRP_MJ_CREATE D:\wc63\http-4529\pwe REPARSE
IRP_MJ_CREATE D:\wc63\http-4529\pwe SUCCESS
IRP_MJ_DIRECTORY_CONTROL D:\wc63\http-4529\pwe\phpinfo.php SUCCESS
In PHP 5.3, it does it reverse manner:
IRP_MJ_CREATE D:\wc63\http-4529\pwe REPARSE
IRP_MJ_CREATE D:\wc63\http-4529\pwe SUCCESS
IRP_MJ_DIRECTORY_CONTROL D:\wc63\http-4529\pwe\phpinfo.php SUCCESS
IRP_MJ_CLEANUP D:\wc63\http-4529\pwe SUCCESS
IRP_MJ_CLOSE D:\wc63\http-4529\pwe SUCCESS
IRP_MJ_CREATE D:\wc63\http REPARSE
IRP_MJ_CREATE D:\wc63\http-4529 SUCCESS
IRP_MJ_DIRECTORY_CONTROL D:\wc63\http-4529\pwe SUCCESS
IRP_MJ_CLEANUP D:\wc63\http-4529 SUCCESS
IRP_MJ_CLOSE D:\wc63\http-4529 SUCCESS
IRP_MJ_CREATE D:\wc63 SUCCESS
IRP_MJ_DIRECTORY_CONTROL D:\wc63\http SUCCESS
IRP_MJ_CLEANUP D:\wc63 SUCCESS
IRP_MJ_CLOSE D:\wc63 SUCCESS
IRP_MJ_CREATE D:\wc63\http SUCCESS
IRP_MJ_FILE_SYSTEM_CONTROL D:\wc63\http SUCCESS
IRP_MJ_CLEANUP D:\wc63\http SUCCESS
IRP_MJ_CLOSE D:\wc63\http SUCCESS
IRP_MJ_CREATE
G:\files\php\php5-3-1-snapshot\pwephpinfo.php NAME NOT FOUND
So PHP 5.3 symbolic link logic resolution logic seems broken :-)
--
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/49039
--
Edit this bug report at http://bugs.php.net/?id=49039&edit=1