php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50220 file_exists fails for files on network share
Submitted: 2009-11-18 14:55 UTC Modified: 2009-12-03 13:19 UTC
From: aiso at chawerim dot nl Assigned: pajoye (profile)
Status: Closed Package: Filesystem function related
PHP Version: 5.3.0 OS: win32 only - window xp
Private report: No CVE-ID: None
 [2009-11-18 14:55 UTC] aiso at chawerim dot nl
Description:
------------
file_exists() fails for files on network share. Although these files can be perfectly read by e.g. file_get_contents(). So these files really do exist!

file_exists() works without problems for files not on a share such as 'C:\Program Files\PHP\php.ini'.

Can reproduce also with '\\\\.HOST\\SHARED FOLDERS\\data\\php.ini'

Using php 5.3.0 (VC9 x86 Non Thread Safe (2009-Jun-30 08:52:54)) on windows XP Pro SP3.

safe_mode is off.

This is tested on windows console (cmd.exe). User is admin and is allowed to go and read files on this share.

Reproduce code:
---------------
$file = '//.HOST/SHARED FOLDERS/data/php.ini';

error_log(substr(file_get_contents($file),0,100));

if (file_exists($file)) {
	error_log("does exist");
} else {
	error_log("does not exist");
}



Expected result:
----------------
First 100 characters of php.ini file + 'does exist'


Actual result:
--------------
First 100 characters of php.ini file + 'does not exist'


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-18 15:15 UTC] pajoye@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-11-18 21:17 UTC] aiso at chawerim dot nl
sorry, can't do: downloaded php-5.3-nts-win32-VC9-x86-latest.msi. But got installation error: code 2711. Just after selected web server setup.
 [2009-11-18 22:50 UTC] pajoye@php.net
You can fetch the zip, uncompress it somewhere and try your script. Or even use it inside IIS as well.
 [2009-11-26 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-12-03 12:48 UTC] aiso at chawerim dot nl
This bug is solved in the latest 5.3 (php-5.3-nts-win32-VC9-x86-latest of 3-12-2009) version. Thanks
 [2009-12-03 13:19 UTC] pajoye@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 08:01:33 2024 UTC