#37318 [Opn->Bgs]: is_file() and file_exist() do not return anything but false...
| From: | tony2001@php.net | Date: | Fri, 05 May 2006 08:05:33 +0000 |
| Subject: | #37318 [Opn->Bgs]: is_file() and file_exist() do not return anything but false... | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-96643@lists.php.net to get a copy of this message | ||
ID: 37318
Updated by: tony2001@php.net
Reported By: ryanericw at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Filesystem function related
Operating System: WinXP
PHP Version: 4.4.2
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Previous Comments:
------------------------------------------------------------------------
[2006-05-05 06:57:17] judas dot iscariote at gmail dot com
I kindly suggest you use a support channel next time.
this is not a bug.
if you read this
http://php.net/manual/en/wrappers.http.php
you will notice that the http:// wrapper do not support stat()
functionality, required for file_exists or is_file to work on
http/https that's the reason why it is returning false, AFAIK it will
only work with FTP and a few others , but in PHP5, not 4.
------------------------------------------------------------------------
[2006-05-05 00:29:08] ryanericw at gmail dot com
Description:
------------
is_file and file_exists() bugged?
Reproduce code:
---------------
I am kind of a newbie at coding PHP, but I recently inserted the code
//if(is_file("$main_link_files/$file"))
if(file_exists("http://www.rfiles.com/rp/downloads/files/remo_test.zip"))
{
header("Location: $main_link_files/$file");
}
else
{
include('inc/site_header.inc');
echo "Sorry, the file you have requested is either invalid or
missing.<br> Please try again later or contact an
administrator.<br>$main_link_files/$file";
}
and all I end up being returned is false, leading me to the "Sorry,
etc". I've tried, is_file() and file_exists(), and have ended up with
the same result.
Now, I'm not sure if this is a problem, but I am actually hosting the
file off of my webspace, which is on another webserver, apart from the
script, which is hosted on my server machine.
I troubleshooted this for hours, and still come up with false, but yet
the direct link works from the header if I remove the checks.
I even made sure all the permissions are set to 777 in the CHMod file
properties.
Any help would be very appreciated.
Thank You.
Expected result:
----------------
True.
Actual result:
--------------
False.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37318&edit=1