|  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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
30 - 25 = ?
Subscribe to this entry?

 [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.
PS In the documentation say nothing about types of path.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-29 01:46 UTC]
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
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the 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 Jul 21 23:01:29 2024 UTC