CLI script & exec() - how to control what gets dumped on the screen.
- From: jochem@xxxxxxxxxxxxx (Jochem Maas)
- Date: Tue, 28 Nov 2006 12:26:22 +0100
I have been trying to figure out how to use exec to run some commandline
scripts (some perl scripts & mysql in this case) WITH the output of the commands
run via exec being shown on the screen.
neither of these examples have the desired effect:
$output = array(); $exit = 0;
exec('apache2ctl graceful', $output, $exit);
$output = array(); $exit = 0;
@exec('apache2ctl graceful', $output, $exit);
please someone tell me there is a decent way to do this (something
to do with STD input/output redirection or something?) and that I'm not left
with trying something like:
ob_start();
$output = array(); $exit1 = $exit2 = 0;
@exec('apache2ctl graceful', $output, $exit1);
ob_end_clean();
.... of which I don't even know if it would work.
anyone care to share their clue?
.
- Follow-Ups:
- Prev by Date: Re: [PHP] Readdir
- Next by Date: RE: [PHP] Readdir
- Previous by thread: combining a text sizer and text only link
- Next by thread: RE: [PHP] CLI script & exec() - how to control what gets dumped on the screen.
- Index(es):
Relevant Pages
|