There probably is a better way to do it. I just haven't been able to figure it out. Most Apache modules wait until the logging stage to execute "offline" code, but it doesn't seem that at that stage PHP code is still in memory. Thus there doesn't seem to be a satisfactory way to do this. As for explicitly closing the connection, I call flush before I do that, and everything that PHP cares about has been done, except for garbage_collecting and unloading itself. Apache goes ahead and cleans up everything else after the logging stage. I haven't tried explicitly with a Connection-Type: Keep-Alive, but I don't think it will cause browsers to crash. I've tested with IE 6x and Mozilla 1.2.1. My implementation was based on code existing in the apache sources (just not externally available in Apache 1.3.x) "lingering_close" and much discussion on the Apache-Modules mailing list.
If you can point me to a place in PHP land where the Apache process has closed the connection, and the script is still in memory, I'll be happy to make it neater, but in my search (I spent a day or so looking for such a place) I couldn't find anything. Another interesting thing to note is that the Patch that worked with 4.1.x to restore the functionality doesn't work with 4.2 or 4.3, so something has changed so that all resource pool cleanup is happening before the connection is closed rather than after, causing PHP to appear slower than it needs to. Joseph > -----Original Message----- > From: Zeev Suraski [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 30, 2002 12:55 PM > > That's a bit of an odd way to implement it - are you sure closing > the link > explicitly at that point won't interfere with anything? In 4.1 (or > whatever the last version it worked like that was), it was taking > advantage > of the fact PHP's resource pool was being destroyed after the link was > already closed. It sounds a bit risky to me to close the link explicitly > at this point, even though I'm not currently aware of any > immediate problem > this may cause (maybe it would ruin keep-alive?) > > Zeev > -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php