What is the reason why error_log() is not working after fastcgi_finish_request()?
Also any error thrown by PHP is not written to the log.
setup: ubuntu18.04 + nginx 1.15.6 + php7.2-fpm, the error log is written to /var/log/nginx/error.log
What is the reason why error_log() is not working after fastcgi_finish_request()?
Also any error thrown by PHP is not written to the log.
setup: ubuntu18.04 + nginx 1.15.6 + php7.2-fpm, the error log is written to /var/log/nginx/error.log
This is not a bug, as stated in https://bugs.php.net/bug.php?id=80628
It's expected behavior.
To solve the "problem", there are two options:
As stated in the documentation:
This function flushes all response data to the client and finishes the request. This allows for time consuming tasks to be performed without leaving the connection to the client open.
So by finishing the request I assume no code after it will be executed like with die()