ID: 48778 Comment by: php at cwdd dot info Reported By: cs at koch-aplsystems dot de Status: Feedback Bug Type: *General Issues Operating System: win32 only - XP SP3 PHP Version: 5.3.0 Assigned To: pajoye New Comment:
I was getting these two warnings when switching from PHP4 to PHP5 on my setup (which included softlink / soft link / junction / junctions) on a wamp server: Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0 Fatal error: Unknown: Failed opening required 'xxx' in Unknown on line 0 That was when I was trying to run 5.3.0. As previously mentioned, junctions work when using 5.2.8. After downgrading to 5.2.8 it immediately solved the problem (ps: for my setup I had to enable short tags) Previous Comments: ------------------------------------------------------------------------ [2009-08-10 20:56:30] mats dot lindh at gmail dot com (If the formatting of this comment gets fubared, I've created a copy online: http://e-mats.org/resources/php-5.3-windows-junctions.txt) Here's a simple test opening a file in PHP instead (I'm guessing that the first open file in the php binary ignores stuff such as streams, etc. and uses another codepath): test.php ======== <?php var_dump(file_get_contents("testcase-junction/test.txt")); var_dump(file_get_contents("testcase/test.txt")); With a snapshot downloaded today vs PHP 5.2.5 (from WAMP, which was the only old installation I had around): F:\temp\php-5.3-win32-VC9-x86-latest>php -v PHP 5.3.1-dev (cli) (built: Aug 10 2009 19:52:21) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies F:\temp\php-5.3-win32-VC9-x86-latest>mkdir testcase F:\temp\php-5.3-win32-VC9-x86-latest>cd testcase F:\temp\php-5.3-win32-VC9-x86-latest\testcase>echo "This is a file" > test.txt F:\temp\php-5.3-win32-VC9-x86-latest\testcase>cd .. F:\temp\php-5.3-win32-VC9-x86-latest>junction testcase-junction testcase Junction v1.05 - Windows junction creator and reparse point viewer Copyright (C) 2000-2007 Mark Russinovich Systems Internals - http://www.sysinternals.com Created: F:\temp\php-5.3-win32-VC9-x86-latest\testcase-junction Targetted at: F:\temp\php-5.3-win32-VC9-x86-latest\testcase F:\temp\php-5.3-win32-VC9-x86-latest>php test.php Warning: file_get_contents(testcase-junction/test.txt): failed to open stream: No such file or directory in F:\temp\php-5.3-win32-VC9-x86-latest\test.php on line 2 bool(false) string(19) ""This is a file" " F:\temp\php-5.3-win32-VC9-x86-latest>dir [snip] 10.08.2009 22:40 <DIR> testcase 10.08.2009 22:41 <JUNCTION> testcase-junction F:\temp\php5.2.5>php -v PHP 5.2.5 (cli) (built: Nov 8 2007 23:18:51) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies F:\temp\php5.2.5>mkdir testcase F:\temp\php5.2.5>cd testcase F:\temp\php5.2.5\testcase>echo "This is a file" > test.txt F:\temp\php5.2.5\testcase>cd .. F:\temp\php5.2.5>junction testcase-junction testcase Junction v1.05 - Windows junction creator and reparse point viewer Copyright (C) 2000-2007 Mark Russinovich Systems Internals - http://www.sysinternals.com Created: F:\temp\php5.2.5\testcase-junction Targetted at: F:\temp\php5.2.5\testcase F:\temp\php5.2.5>php test.php string(19) ""This is a file" " string(19) ""This is a file" " F:\temp\php5.2.5>dir [snip] 10.08.2009 22:46 <DIR> testcase 10.08.2009 22:46 <JUNCTION> testcase-junction (This does not involve the DocumentRoot as in the first test case, and should hopefully be easier to isolate) ------------------------------------------------------------------------ [2009-08-10 15:33:37] paj...@php.net Can you using CLI or FastCGI please? Using: F:\wc63>dir c:\temp\ 10.08.2009 17:30 <JUNCTION> foo [f:\] and this call: php-cgi.exe c:\temp\foo\wc63\http\pwe\t.php it works just fine (CLI/FCGI). It could be an apache only problem. ------------------------------------------------------------------------ [2009-08-09 16:20:58] tswsl1989 at sucs dot org Problem also occurs when trying to access a junction contained within the DocumentRoot of Apache. Apache/2.2.11 (Win32) PHP/5.3.0 NTFS 3.1 on both drives. Error occurs accessing <docroot>\igal, where <docroot>\igal is a junction to O:\ ------------------------------------------------------------------------ [2009-07-20 20:33:57] phpstuff at cresstone dot com Reproduced, some things seem ok on previous versions. Where the NTFS folder 'c:\mnt\drive1' is a mounted drive... Using 5.3, is_dir('c:\mnt\drive1') returns false, and other filesystem functions like scandir fail. However, using the 5.2.10 zip package, is_dir returns true and scandir correctory enumerates the directory. ------------------------------------------------------------------------ [2009-07-09 20:38:23] Steve at b-en-e dot com Confirmed here. 5.2.8 does not have this problem, but 5.2.10 does, so it was introduced in the previous versions. Removing the junction from the picture solves the problem. Note that it is not only the source files: if the error log is directed to a junctioned folder apache ends the request with a connection reset by peer. ------------------------------------------------------------------------ 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/48778 -- Edit this bug report at http://bugs.php.net/?id=48778&edit=1