note 15445 deleted from function.exec by irchtml

From: Date: Wed, 25 Feb 2004 13:32:58 +0000
Subject: note 15445 deleted from function.exec by irchtml
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-65709@lists.php.net to get a copy of this message
Note Submitter: jeff at iomojo dot com ---- When executing a program in the background AND using sessions, subsequent clicks in the browser won't do anything until after the background process finishes. Even though control is returned to the browser, all clicks will hang. <p> To get around this, here's what I did: <p> <? session_start(); $userid = $HTTP_SESSION_VARS["userid"]; //... assign $command to the command to execute exec("$command >/dev/null &"); session_unregister("userid"); session_destroy(); session_start(); session_register("userid"); // rest of script. ?> <p> It's a hack because you get a new session id, but if you can live with that, it may be of some help. <p> Note: This is 4.06 / apache 1.3.20 / linux

« previous php.notes (#65709) next »