|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-09-19 14:10 UTC] iliaa@php.net
[2002-09-21 16:20 UTC] fil at rezo dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 13:00:01 2025 UTC |
Hi I can see many "Closed" versions of this bug report. It definitely is causing me problems, hence this report. I think that Apache 2.0.39 / php 4.2.1 was working, as my code broke after installing Apache 2.0.40 / php 4.2.3. I always build apache and php with the same options. The server is running as 'nobody'. is_file() behaves better, although it's not the function I want to use. A test case... (is_file.php) I would expect is_file and file_exists to give the same results in this test... They don't! <?php function lookfor($filename) { $wd = getcwd(); echo "<b>Looking for '$filename'</b><br>\n"; $path = ""; for ($i = 0; $i < 20; $i++) { $if = is_file($path . $filename) ? 1 : 0; clearstatcache(); $fe = file_exists($path . $filename) ? 1 : 0; echo "$if $fe : '$path' ($wd/$filename)<br>\n"; if ($if) break; $path .= "../"; $wd = dirname($wd); if ($wd == "/") $wd = ""; } echo "<br>\n"; } echo "Starting from '".getcwd()."' (allegedly)<br>\n"; lookfor('System.map'); lookfor('is_file.php'); lookfor('index.php'); ?> Gives: Starting from '/usr/local/apache2/htdocs/test' (allegedly) Looking for 'System.map' 0 1 : '' (/usr/local/apache2/htdocs/test/System.map) 0 1 : '../' (/usr/local/apache2/htdocs/System.map) 0 1 : '../../' (/usr/local/apache2/System.map) 0 1 : '../../../' (/usr/local/System.map) 0 1 : '../../../../' (/usr/System.map) 1 1 : '../../../../../' (/System.map) Looking for 'is_file.php' 1 0 : '' (/usr/local/apache2/htdocs/test/is_file.php) Looking for 'index.php' 0 0 : '' (/usr/local/apache2/htdocs/test/index.php) 1 0 : '../' (/usr/local/apache2/htdocs/index.php) Thanks /nick