From: offset at galvanet dot com
Operating system: Linux
PHP version: 5.2.9
PHP Bug Type: Filesystem function related
Bug description: stat failed on a readable / writable file
Description:
------------
is_file and filesize not working on a NFS mount.
These files are readable and writable for user (Using PHP CLI).
is_file and filesize working for local files. Not for NFS mounts.
By the way, file_exist is working.
The code is working under PHP 5.2.3 (cli). And not under PHP 5.2.9 (cli)
Reproduce code:
---------------
echo "Full path : $SourceFile\n";
if (!chmod($SourceFile, 0777)) {
echo "Unable to Chmod file\n";
}
clearstatcache();
if (!file_exists($SourceFile)) {
echo "Source file not found\n";
}
$FileSize = filesize($SourceFile);
if (!$FileSize) {
echo "Source file empty !\n";
}
Expected result:
----------------
Full path : /home/files/3/4/0/340db92364af5c0616187f6e1db86ed7
.. and continue the script
Actual result:
--------------
Full path : /home/files/3/4/0/340db92364af5c0616187f6e1db86ed7
Source file empty !
# ls -lah /home/files/3/4/0/340db92364af5c0616187f6e1db86ed7
-rwxrwxrwx 1 nobody nobody 9.5M Apr 26 12:00
/home/files/3/4/0/340db92364af5c0616187f6e1db86ed7
--
Edit bug report at http://bugs.php.net/?id=48099&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48099&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48099&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48099&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48099&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=48099&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48099&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=48099&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=48099&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=48099&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=48099&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=48099&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=48099&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=48099&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48099&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48099&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48099&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=48099&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=48099&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=48099&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=48099&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=48099&r=mysqlcfg