exec in CLI vs. mod_php

From: Date: Thu, 29 May 2003 17:54:14 +0000
Subject: exec in CLI vs. mod_php
Groups: php.internals 
Request: Send a blank email to internals+get-2082@lists.php.net to get a copy of this message
I am trying to figure out what is internally different about exec between CLI and mod_php. If exec() a script from CLI and said script forks, I get my prompt right back. test.php ------------ <?php exec("/home/brianm/fork.php"); ?> fork.php ------------ #!/usr/local/bin/php <?php $pid = pcntl_fork(); if ($pid == -1) { trigger_error("Could not fork __FILE__", E_USER_ERROR); exit(); } elseif($pid>0) { exit(); } touch("/tmp/file.txt"); sleep(5); ?> However, if I run test.php from mod_php in Apache, the parent zombies and exec() waits for the forked process to finish. What is the difference here and is there any hope of having exec in mod_php work the same as it does in CLI? Brian Moon dealnews.com

« previous php.internals (#2082) next »