From:             
Operating system: 
PHP version:      5.3.2
Package:          Filesystem function related
Bug Type:         Bug
Bug description:Include() sporadicly fails when is_file()/is_readable() == TRUE 

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 bug report at http://bugs.php.net/bug.php?id=52398&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=52398&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=52398&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=52398&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=52398&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52398&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=52398&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=52398&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=52398&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=52398&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=52398&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=52398&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=52398&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=52398&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=52398&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=52398&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=52398&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=52398&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=52398&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=52398&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=52398&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=52398&r=mysqlcfg

Reply via email to