Re: Capturing output of shell script.
| From: | Charles Williams | Date: | Mon, 02 Jul 2001 20:56:34 +0000 |
| Subject: | Re: Capturing output of shell script. | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-55900@lists.php.net to get a copy of this message | ||
correction below
chuck
----- Original Message -----
From: "Charles Williams" <hosting.mailing.list.account@acnshosting.com>
To: <brad@congosystems.com>; "Php-General (E-mail)"
<php-general@lists.php.net>
Sent: Monday, July 02, 2001 10:54 PM
Subject: Re: [PHP] Capturing output of shell script.
>
> ----- Original Message -----
> From: "Brad Hubbard" <brad@congosystems.com>
> To: "Charles Williams" <hosting.mailing.list.account@acnshosting.com>;
> "Php-General (E-mail)" <php-general@lists.php.net>
> Sent: Saturday, June 30, 2001 1:12 PM
> Subject: Re: [PHP] Capturing output of shell script.
>
>
> > On Sat, 30 Jun 2001 06:36, Charles Williams wrote:
> > > Hello all,
> > >
> > > I have an .sh shell script being executed from a php4 call. I need to
> > > capture the string return and work with that in the php script. The
> only
> > > problem is that the call works but I cannot get the returned string.
> I've
> > > tried using exec, passthru, ``, system, and escapeshellcommand.
Nothing
> > > seems to work. any ideas?
> >
> > $capture =
script.sh 2>&1; // redirect standard
> > error to standard
output
> >
> >
> > Cheers,
> > Brad
>
> Brad,
>
> Here is what I am trying to execute:
>
> $pass_string = "super cadduser -f \"".$full_name."\" -u
> \"".$Username."\" -p \"".$Password."\" -q
> \"".$Quota."\" -x -d
> ".$top_domain;
The above should be one line.
> exec($pass_string, $ary_result);
> echo "Result: ";
> # var_dump($ary_result);
> return $ary_result;
>
> For some reason it will only continue execution past the 'exec' call
rarely.
> Most of the time the script just stops after the exec call (the echo and
> below is not executed). When it does go beyond the 'exec' call the
var_dump
> (that I use for testing only. will be gone when working) does show as an
> array.
>
> I have the max_execution_time set to 180 so I know the script isn't
timeing
> out. Any ideas? I have never run into this problem before.
>
> thanks
> chuck
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>