note 99480 deleted from function.pcntl-fork by danbrown

From: Date: Thu, 19 Aug 2010 15:15:15 +0000
Subject: note 99480 deleted from function.pcntl-fork by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-171855@lists.php.net to get a copy of this message
Note Submitter: Anonymous ---- PLEASE DELETE MY PREVIOUS COMMENT As suggested by some guy who's comment was for some reason deleted, lines <?php //Kill parent process now (self) to prevent zombie creation. posix_kill(posix_getpid(), SIGTERM); ?> Can be replaced with: <?php pcntl_signal(SIGCHLD, SIG_IGN); ?> But latter can be platform-dependent (see http://en.wikipedia.org/wiki/SIGCHLD) and also it can lead to the unexpected behavior in shell_exec, proc_open functions if you do not reinstall SIGCHLD handler, because they handle SIGCHLD signal, so i advise to use former solution. Personally i tested this solution on Linux 2.6.34-12 and FreeBSD 8.0 and it works perfectly.

« previous php.notes (#171855) next »