#37318 [NEW]: is_file() and file_exist() do not return anything but false...
| From: | ryanericw at gmail dot com | Date: | Fri, 05 May 2006 00:29:08 +0000 |
| Subject: | #37318 [NEW]: is_file() and file_exist() do not return anything but false... | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-96628@lists.php.net to get a copy of this message | ||
From: ryanericw at gmail dot com
Operating system: WinXP
PHP version: 4.4.2
PHP Bug Type: Filesystem function related
Bug description: is_file() and file_exist() do not return anything but false...
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 bug report at http://bugs.php.net/?id=37318&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37318&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=37318&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37318&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37318&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=37318&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37318&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37318&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37318&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37318&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37318&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=37318&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=37318&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37318&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37318&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37318&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37318&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37318&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37318&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37318&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37318&r=mysqlcfg