Re: spawning a process that uses pipes - doesn't terminatewhen webpage download is canceled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2009-06-01 at 05:15 -0500, flint wrote:
> ----- Original Message ----- 
> From: "Robert Cummings" <robert@xxxxxxxxxxxxx>
> To: "flint" <fmillion@xxxxxxxxx>
> Cc: "PHP-General List" <php-general@xxxxxxxxxxxxx>
> Sent: Sunday, May 31, 2009 10:15 PM
> Subject: Re:  spawning a process that uses pipes - doesn't 
> terminatewhen webpage download is canceled
> 
> I'm already doing something like that... here's what I have basically
> 
> $o = popen($cmd);
> while (!feof($o)) {
>   $buffer = fread($o,4096);
>   echo $p;
> }
> exit();
> 
> Ok so I can add in the statements to stop auto aborting, use connection 
> aborted... but how do i kill the process chain itself? If I simply pclose 
> the process it has the same effect - the other spawned processes keep 
> running. I figured out what's happening is the lame process keeps going 
> utnil it finishes, and apparently is sending its data to the proverbial bit 
> bucket... and in a process tree it moves from being under the http process 
> to being under init itself...

You can use the linux shell command ps:

    exec( 'ps --ppid '.getmypid(), $children );

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux