News Feed
Jobs Feed
Sections




News Archive
Paul Reinheimer's Blog:
When does a user abort?
October 03, 2007 @ 07:52:00

Paul Reinheimer recently discovered something interesting about how PHP handles users aborts (hitting the stop button in the browser, closing it) and the steps the language follows after that.

I was under the impression that when the user hit stop, the script stopped. Which is: bad, and wrong. PHP doesn't detect that the user has terminated the connection, it has no clue, it obligingly continues processing along, until it attempts to send information to the user.

The "ignore_user_abort" configuration option in the php.ini controls some of this, allowing for you to specify whether or not the script should go ahead and finish out even after PHP has discovered that the client has been disconnected. There's also a function that allows you to specify the same thing on a script-by-script basis (in both PHP4 and PHP5).

0 comments voice your opinion now!
user abort script phpini ignoreuserabort disconnect user abort script phpini ignoreuserabort disconnect


blog comments powered by Disqus

Similar Posts

Tiger Heron Blog: First steps with PHP - booting a script, Part 2

Atlanta PHP Users Group: May Meeting Location Update

SitePoint PHP Blog: PHP Frontend for Xdebug Profiling?

Utah PHP Users Group: Meeting May 18th 2006 @ 7pm

PHPit.net: Creating a chat script with PHP and Ajax, Part 1


Community Events











Don't see your event here?
Let us know!


unittest opinion zendframework2 symfony2 testing community introduction framework database usergroup functional development rest series language conference phpunit interview release podcast

All content copyright, 2013 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework