[php-src] Issue #12486: Errors after fastcgi_finish_requests are not logged to error_log

From: Date: Fri, 20 Oct 2023 12:00:11 +0000
Subject: [php-src] Issue #12486: Errors after fastcgi_finish_requests are not logged to error_log
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-245612@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/12486 Author: php4fan ### Description Consider code with PHP-FPM: ```php <?php echo "Hi!"; fastcgi_finish_request(); sleep(10); file_put_contents("test.log", date('c') . "\n\n", FILE_APPEND); ksbkdbsd(); ``` Expected result === 10 seconds after the response has been sent to the client, this should write the current time to the file test.log, and also this should result in an error being logged, because the script is calling a function that doesn't exist. Observed result === The client immediately receives the response, and the current time _is_ written to the file test.log, demonstrating that fastcgi_finish_request() is working, and that script execution is continuing as expected after it. However, no error is logged to the error log (in my case ./logs/error_log). If I remove the line fastcgi_finish_request(), then I do see the error logged : "Fatal error: Uncaught Error: Call to undefined function ksbkdbsd()". This demonstrates that it's not an issue with my error reporting configuration. ### PHP Version PHP 7.4.11 ### Operating System _No response_

« previous php.bugs (#245612) next »