|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-09-24 03:43 UTC] cataphract@php.net
-Status: Open
+Status: Bogus
[2010-09-24 03:43 UTC] cataphract@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Description: ------------ I am using PHP 5.2.14 built from source on CentOS 4.8. This also happens in PHP 5.2.13. Basically what is happening is that if I run the following code (from a web address, not CLI), and terminate before sleep() is done performing, I do not see the last error_log(). I only see the one before fpassthru(). This only happens when $content is very large (not sure how large, but my script was using ~15MB string). It appears that if I add ob_start() and ob_end_flush() around the script, everything performs correctly, even if I terminate the script early. I have already verified that the content is in fact being written to $file just fine. I manually checked the file and also called file_get_contents() after file_put_contents() and the data came back just fine. Again, I receive no errors in the PHP error log or Apache log (e.g. no segfaults). Test script: --------------- // $content must be much larger than this sample...something like 15MB of base64 // encoded data will do the trick. $content = 'JVBERi0xLjQKJeTjz9IKNjMgMCBvYmoKPDwKL0xpbmVhcm'; file_put_contents($file, $content); // $file is a valid full file path/name $fp = fopen($file, 'r'); sleep(5); // This is only here to aid in terminating the script before fpassthru() is called. error_log('Error log before fpassthru() is called!'); $characterCount = fpassthru($fp); error_log(var_export($characterCount, true)); Expected result: ---------------- I would expect fpassthru() to not totally kill the script. Even though the client will not see the contents of fpassthru(), the rest of the script should still perform as expected. Actual result: -------------- The script terminates before the last error_log is called and no errors are displayed, no segfaults reported, etc., even when the highest PHP error logging is enabled.