php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19784 file_exists doesn't work
Submitted: 2002-10-06 14:59 UTC Modified: 2002-10-22 01:00 UTC
Votes:8
Avg. Score:4.4 ± 0.9
Reproduced:6 of 6 (100.0%)
Same Version:4 (66.7%)
Same OS:5 (83.3%)
From: m dot martinello at iol dot it Assigned:
Status: No Feedback Package: *Directory/Filesystem functions
PHP Version: 4.2.3 OS: Linux 2.4.18
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2002-10-06 14:59 UTC] m dot martinello at iol dot it
I am using php 4.2.3 with httpd 2.0.43.
The functions file_exists, is_file and file_size doesn't work at all.
file_exists("file.txt"); gives me "false" even if the file "file.txt" exists in the same directory of the script containing that function.
If I use the full path of "file.txt", file_exists("/full/path/to/file.txt"); gives me "true" and works well.

How to solve this problem? I can't use the full path in the scripts.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-06 14:59 UTC] derick@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip
 [2002-10-22 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over 2 weeks, 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".
 [2006-06-26 15:37 UTC] mrueegg at metaworx dot ch
as to my experiance file_exists uses the current working directory [getcwd()] for relative path's and not the directory the script is in.

tested in v5.1.4 and 5.2-dev (26-Jun-2006 16:19)
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Sep 16 19:03:38 2021 UTC