From: Operating system: Windows xp PHP version: 5.3.2 Package: Output Control Bug Type: Bug Bug description:PHp seems to run out of memory
Description: ------------ For my site I generate a large number of PHP pages from a PHP script. Experience learns that PHP is not totally realiable and that some of the pages will contain errors. The errors may be small but unlike html PHP is unforgiving and it immediately results in a single php error line. So I made a script to check all my php files. I use the output buffering functions to direct their output to a file. I then measure the size of this output. If this is extremely small it must be a PHP error line. After reading some 30 to 120 files PHP just stops. For a given directory it is always the same. Total filesize (all files together) before the stop varied between 500 and 3500 kb. Test script: --------------- function checkfile($myfile) { if (!file_exists($myfile)) return; echo $myfile."<br>"; ob_start(); include($myfile); $data = ob_get_contents(); ob_end_clean(); if(strlen($data) < 500) echo "<h2>".$myfile." is too small!</h2>"; } $dp = opendir("./")); while( $dirfile = readdir($dp)) { if(($dirfile == ".") || ($dirfile == "..")) // all files are php continue; checkfile($dirfile); } closedir($dp); Expected result: ---------------- I would expect that the script would process all the files in the directory Actual result: -------------- Instead it just processes a certain number and then stops. This is no timeout: it happens within a second. -- Edit bug report at http://bugs.php.net/bug.php?id=52252&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52252&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52252&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52252&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52252&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52252&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52252&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52252&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52252&r=needscript Try newer version: http://bugs.php.net/fix.php?id=52252&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52252&r=support Expected behavior: http://bugs.php.net/fix.php?id=52252&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52252&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52252&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52252&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52252&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=52252&r=dst IIS Stability: http://bugs.php.net/fix.php?id=52252&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52252&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52252&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52252&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52252&r=mysqlcfg