Re: stupid newbie question
| From: | J Smith | Date: | Fri, 05 Oct 2001 14:47:19 +0000 |
| Subject: | Re: stupid newbie question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70089@lists.php.net to get a copy of this message | ||
Actually, there is a unix-like fork() function in an extension. exec() will
execute another process, but it isn't really a fork().
Look at the pcntl extension and check out pcntl_fork(). I've been working
with it for a few days and it works pretty well. It's still marked
EXPERIMENTAL, so don't rely too much on it. I have no idea as to its
stability. And it's probably only truly useful for command line php.
(As for the funkyness, kill zombies with pcntl_waitpid().)
J
Richard Lynch wrote:
> http://php.net/exec
>
> You'll need to use & in the command to be executed.
>
> That command may or may not need to be wrapped up in a shell script to
> muck with stdin/stderr/stdout so that PHP isn't waiting for those to be
> freed
> up... Or something like that. I don't really understand it, I just know
> that programs that use stdin/stdout/stderr have to be treated funky.
>
> --
> WARNING richard@zend.com address is an endangered species -- Use
> ceo@l-i-e.com
> Wanna help me out? Like Music? Buy a CD: K™°
> Ï×·Cõ.4±&ò§Hhttp://l-i-e.com/artists.htm
> Volunteer a little time: http://chatmusic.com/volunteer.htm
> ----- Original Message -----
> From: Paul Procacci <procacci@procacci.net>
> Newsgroups: php.general
> To: <php-general@lists.php.net>
> Sent: Thursday, October 04, 2001 10:12 PM
> Subject: stupid newbie question
>
>
>> How do u fork?
>>
>> Thanks ahead of time : )
>>