ID:               28032
 Updated by:       [EMAIL PROTECTED]
 Reported By:      bg at rjservices dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Filesystem function related
 Operating System: n/a (fails on linux/win32)
 PHP Version:      4.3.4
 New Comment:

file_exists() works on the file-system level..



Please ask further support questions on the appropriate mailing list.




Previous Comments:
------------------------------------------------------------------------

[2004-04-16 21:33:49] bg at rjservices dot com

Description:
------------
I have searched the bug reports, and have seen other reports of this
problem that were closed; however they were pretty old, and the bug
persists.



BUG:

If an absolute path is used with the file_exists() function, it will
ALWAYS report the file doesn't exist.

ie: file_exists('/images/mypic.gif') ALWAYS reports false.



Only by specifying a relative path, will the function start working.



Although my ISP is still running php 4.2.3, I've checked the change
log, and there is no indication that this bug has been addressed.

I have no control over my ISP, and therefore no ability to upgrade;
however, as I've said, there is nothing in ANY of the changelogs to
indicate this bug has been addressed.



Reproduce code:
---------------
here is sample code illustrating the problem:

you may observe the code here (and get source):

http://www.rjservices.com/bugs/fileexist.php



<html><body><BR>

this file is using php's  file_exists() function to look at
itself.<br>

the function ONLY works correctly if a RELATIVE path for the filename
is used!<br>

if an absolute path is used, is ALWAYS reports the file doesn't
exist!<br>

<?php

$g="../bugs/fileexist.php";

$b="/bugs/fileexist.php";

if (file_exists($g)) $t="true"; else $t="false";

print "\n<BR>good file is ".$g." and it exists? - ".$t;

if (file_exists($b)) $t="true"; else $t="false";

print "\n<BR>bad file is ".$b." and it exists? - ".$t;

?>

<BR><BR>

here's the code used in this file:

<a
href="http://www.rjservices.com/bugs/fileexist.php.txt";>fileexist.php</a>

<br>

This system is running PHP 4.2.3, and   Apache/1.3.23<br>

and runs on (Red-Hat/Linux)  PHP/4.2.3 <br>

</body></html>



Expected result:
----------------
file_exists("/bugs/fileexist.php") SHOULD return TRUE;

it doesn't. (and the file DOES exist:)



Actual result:
--------------
file_exists("/bugs/fileexist.php") returns FALSE;

(and the file DOES exist)


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=28032&edit=1

Reply via email to