ID: 15209 Updated by: [EMAIL PROTECTED] Reported By: priebe at mi-corporation dot com -Status: Verified +Status: Bogus Bug Type: Scripting Engine problem Operating System: RH Linux 7.3 PHP Version: 4.1.x-4.3.0 New Comment:
Closing as bogus. If we ever support this kind of behavior, it won't be a part of register_shutdown_function(). If there was a working patch for apache_register_shutdown_function(), I missed it - please resend. Previous Comments: ------------------------------------------------------------------------ [2002-12-30 11:26:27] [EMAIL PROTECTED] The functionality for register_shutdown_function under 4.0.x will be replaced with a function named apache_register_shutdown_function. This should be available under 4.3.1 and later versions of PHP. I will close this bug when the patch has been committed. ------------------------------------------------------------------------ [2002-12-27 10:52:01] [EMAIL PROTECTED] I created a patch to add this functionality back under mod_php4 systems. This patch was posted to the php-dev list yesterday. Check out the list archives. An improved patch will be posted later today. ------------------------------------------------------------------------ [2002-12-23 11:25:38] brianm-php at dealnews dot com The following script will cause IE to stop loading the page when zlib.output_compression is used. This was not true before the changes to register_shutdown_function as the output was not sent. You can see a test at http://dealnews.com/zlibshutdown.php. Mozilla gracefully handles the mixed output by truncating the non-compressed data. ================================ <?php register_shutdown_function("shutdown_test"); ?> <html> <head> <title></title> </head> <body bgcolor="#ffffff" leftmargin="8" topmargin="8" marginheight="8" marginwidth="8"> This is in the HTML body. <?php function shutdown_test() { echo "This is the shutdown function."; } ?> </body> </html> ------------------------------------------------------------------------ [2002-12-12 11:37:31] [EMAIL PROTECTED] I gave up on my patch. Too much work, not enought time, and ultimately, I couldn't find a place in PHP land where PHP was still running and Apache had closed the connection to put my hooks in. There may be a way to tell Apache to close the connection through SAPI, but I am not aware of it. (I'm not an apache hacker). Someone posted a way to fork a process to the background, but it isn't a PHP land solution. >From Carsten Gehling: Maybe this is what you need? http://www.naken.cc/mikehup.php I use this on a CMS site, where the users upload imagefiles with ftp. After that, they use a php webinterface to start an importscript (written in Perl). By doing this command in php: system("/usr/local/bin/mikehup /usr/bin/perl /www/servers/netlag/cronscripts/import_billede.pl &"); The importscript is started and executes in the background while the php-script finishes execution. Hope that helps - Carsten ------------------------------------------------------------------------ [2002-12-12 10:06:43] sts at mail dot xubion dot hu I copy my mail sent to the dev list here too, to make it more noticable: I know there was some hot discussion about this topic but I really need to get this bug fixed. Even I'll make a patch with my zero knowledge of c if no one would like to make it, but please try to find a reasonable sollution that fits (almost) everyone's need. I thought of one. I think a new function with the name register_apache_shutdown_function (or somethink like this) might be good. It's name would say that it only works in apache, it could be documented that it's the *only* function that closes the connection before the registered functions are handled. Or maybe a parameter could tell if the connection should be closed before the first registered function is started. I'll hope there's some way to solve this problem, because it's not easy to tell every customer to use our patch (or use 4.0.6) before they are staring to use our programs that rely on this forgotten feature. Thanks, Arpi ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/15209 -- Edit this bug report at http://bugs.php.net/?id=15209&edit=1