From: Operating system: Windows XP SP3 PHP version: master-Git-2012-04-05 (snap) Package: Apache related Bug Type: Bug Bug description:readfile() resp. fpassthru() try to allocate complete file into memory
Description: ------------ Tested on: - PHP 5.5.0dev (r324251) as Apache 2.2 module - Apache 2.2.22 This bug applies to the Apache module on Windows only. The cgi version does not show this behavior. I narrowed it down to PHP 5.2.10. Before that version the test script runs without error. Test script: --------------- <?php //test.bin has 200 MB readfile('test.bin'); ?> Expected result: ---------------- No error Actual result: -------------- Immediate result (doesn't even begin to load the file): Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 209719296 bytes) in C:*\readfile.php on line 4 -- Edit bug report at https://bugs.php.net/bug.php?id=61636&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61636&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61636&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61636&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=61636&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61636&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=61636&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=61636&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=61636&r=needscript Try newer version: https://bugs.php.net/fix.php?id=61636&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=61636&r=support Expected behavior: https://bugs.php.net/fix.php?id=61636&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=61636&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=61636&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=61636&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61636&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=61636&r=dst IIS Stability: https://bugs.php.net/fix.php?id=61636&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=61636&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=61636&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=61636&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=61636&r=mysqlcfg