|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-07-22 02:30 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 00:00:01 2025 UTC |
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.