Looking at this PHP Man page:
http://php.net/manual/en/features.connection-handling.php
I quote:
You can decide whether or not you want a client disconnect to cause your script to be aborted. Sometimes it is handy to always have your scripts run to completion even if there is no remote browser receiving the output. The default behaviour is however for your script to be aborted when the remote client disconnects. This behaviour can be set via the
ignore_user_abort
php.ini directive as well as through the correspondingphp_value ignore_user
_abort Apachehttpd.conf
directive or with theignore_user_abort()
function. If you do not tell PHP to ignore a user abort and the user aborts, your script will terminate.The one exception is if you have registered a shutdown function using
register_shutdown_function()
. With a shutdown function, when the remote user hits his STOP button, the next time your script tries to output something PHP will detect that the connection has been aborted and the shutdown function is called. This shutdown function will also get called at the end of your script terminating normally, so to do something different in case of a client disconnect you can use theconnection_aborted()
function. This function will returnTRUE
if the connection was aborted.