Edit report at http://bugs.php.net/bug.php?id=52398&edit=1
ID: 52398 Comment by: smiths73v3 at gmail dot com Reported by: smiths73v3 at gmail dot com Summary: Include() sporadicly fails when is_file()/is_readable() == TRUE Status: Open Type: Bug Package: Filesystem function related PHP Version: 5.3.2 New Comment: The failure generates the following output in the lighttpd error log when debug.log-request-handling = "enable" ------------------- 2010-07-18 23:37:29: (mod_fastcgi.c.2711) FastCGI-stderr: PHP Warning: include(/var/www/components/com_php/files/special_include.php): failed to open stream: No such file or directory in /var/www/components/com_php/php.php on line 50 ------------------- Downgrading the system to 5.2.10 (karmic) is a workaround for the issue. Previous Comments: ------------------------------------------------------------------------ [2010-07-22 02:30:35] smiths73v3 at gmail dot com Description: ------------ Running Joomla with lighttpd, fastcgi, mysql. About 1 in 5 loads of alternating pages, an error is encountered where is_readable($path) is true, but the include fails. The file system has plenty of space, the file does exist, permissions are correct, and the file is loaded successfully the other 4 times. The code snippet below will sometimes fail with "Include failed" and then a subsequent reload of the page will succeed with "Include Success" ----------------------------- $path = 'somefile.php'; if (is_readable($path)) { $retval = include $path; echo '<span class="note">Include retval='.$retval.'</span>'; if ($retval == '') { echo '<span class="note">Include failed</span>'; }else { echo '<span class="note">Include Success</span>'; } } else { echo '<span class="note">File not readable</span>'; } Test script: --------------- $path = 'somefile.php'; if (is_readable($path)) { $retval = include $path; echo '<span class="note">Include retval='.$retval.'</span>'; if ($retval == '') { echo '<span class="note">Include failed</span>'; }else { echo '<span class="note">Include Success</span>'; } } else { echo '<span class="note">File not readable</span>'; } Expected result: ---------------- Include Success Actual result: -------------- Include failed ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52398&edit=1