php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20710 file_exists() doesn't work normally
Submitted: 2002-11-29 01:44 UTC Modified: 2002-11-29 02:25 UTC
From: pomozoff at mail dot ru Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.2.3 OS: Linux RedHat 7.2
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pomozoff at mail dot ru
New email:
PHP Version: OS:

 

 [2002-11-29 01:44 UTC] pomozoff at mail dot ru
file_exists() function returns false on the relative path to the file, which is REALLY exists. But its working well if the path is absolute.
code sample:

$filename = "./template/sub/install.txt";
if (!file_exists($filename))
{
 $fd = fopen ($filename, "r");
 $contents = fread ($fd, filesize ($filename));
 fclose ($fd);

 die("Error - file $filename does not exist.\n $contents");
}

try it, and marvel.
why?
PS In the documentation say nothing about types of path.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-29 01:46 UTC] edink@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, 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/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.
 [2002-11-29 02:25 UTC] pomozoff at mail dot ru
Thx, all is working now ^)
 [2002-11-29 02:25 UTC] pomozoff at mail dot ru
Thx, all is working now :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 12:01:28 2024 UTC