I have a very strange behavior with is_file() or file_exists() function.
<?php $nfsFile = '/mnt/nfsdir/file.txt'; var_dump(is_file($nfsFile)); ?>
this code开发者_如何学JAVA returns FALSE all the time, but:
$#php -r 'var_dump(is_file('/mnt/nfsdir/file.txt'));'
returns TRUE, which is correct.
I'm running Debian Squeeze, Apache 2.2.15 and PHP 5.3.2-1.
I'm not in safe mode, the directory /mnt/nfsdir/ and all files are in 777, www-data user can ls /mnt/nfsdir/ so I'm a bite out of idea now.
Any suggestion are welcome!
Looks realy like a server config issue to me.
Maybe test if echo exec('ls /mnt/nfsdir/file.txt');
works.
I don't think so. Cause it seams, even if www-data can access the file, PHP is not allowed to access it.
But if exec('ls /mnt/nfsdir/file.txt');
works this could be a solution for you.
Otherwise I would have a look at the server config again.
精彩评论