Re: Re: [PHP] Browser hangs with exec, HELP!!!!!
| From: | Chris Carbaugh | Date: | Mon, 13 Nov 2000 19:39:50 +0000 |
| Subject: | Re: Re: [PHP] Browser hangs with exec, HELP!!!!! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-25019@lists.php.net to get a copy of this message | ||
On Mon, 13 Nov 2000, Juan Claudio Santana Saldaña wrote:
> Date: Mon, 13 Nov 2000 13:04:38 -0600
> To: cjtech2000@yahoo.com
> From: Juan Claudio Santana Saldaña <claudio@santana.net>
> Reply-To: claudio@santana.net
> Subject: Re: [PHP] Browser hangs with exec, HELP!!!!!
>
> I've even changed my code to avoid the shell script and made up just
> a test
> program, the shell script had the same commands I try to run now with
> the
> php exec sentence, the code is the following:
>
> echo exec(EscapeShellCmd("killall ensniff > /dev/null 2>&1"));
> echo exec(EscapeShellCmd("killall filter > /dev/null 2>&1"));
> echo exec(EscapeShellCmd("/home/dbuser/ensniff eth0 & > /dev/null
> 2>&1"));
> echo exec(EscapeShellCmd("/home/dbuser/filter & > /dev/null 2>&1"));
>
Your missing the '&' at the end of each line. The '2>&1' just pipes
stderr to stdout, you still need the '&' at the end to kick it to the
background.
I would think that when you run the script, the 'ensniff' and 'filter'
processes are getting killed. (correct?)
And 'ensniff eth0' is started, (correct?) but then your script hangs
(it's waiting on ensniff to exit).
Chris
> It hangs executing the 3rd. line. The original processes run as
> nobody.
> Even one of the processes fails the script should be executed to the
> end,
> the error output should be catched by the /dev/null and the page
> should be
> shown. HELP!!!!!!!
>
> Claudio.