Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #4612
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsfeed.straub-nv.de!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | "M. Strobel" <sorry_no_mail_here@nowhere.dee> |
| Newsgroups | comp.lang.php |
| Subject | Re: redirect stdout and stderr to PHP variables? |
| Date | Wed, 25 Jan 2012 22:42:36 +0100 |
| Lines | 34 |
| Message-ID | <9obbadF6enU1@mid.uni-berlin.de> (permalink) |
| References | <jfpm810drs@news2.newsguy.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | quoted-printable |
| X-Trace | news.uni-berlin.de dMNU+j5zuGrAceOyml5D8A7dVxrXh+h2BzAsEREvMI5RNlSAw= |
| User-Agent | Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.24) Gecko/20111101 Thunderbird/3.1.16 |
| In-Reply-To | <jfpm810drs@news2.newsguy.com> |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.php:4612 |
Show key headers only | View raw
Am 25.01.2012 20:47, schrieb crankypuss:
> I'm sure there's a way to do this, probably some simple syntax I've not run into and
> am too stupid to find in the manual or through google-fu or otherwise.
>
> I'd like to issue an arbitrary shell command in a subroutine and have it return an
> array that contains one element representing stdout and another element representing
> stderr.
>
> For example, using tar to deal with a bazillion files, error messages might not be
> seen when specifying verbose output; I'd like to collect them and display after stdout.
>
> I've not found any syntax, yet, for redirecting to a PHP variable rather than some file.
>
> tia.
No problem here:
php > $res = shell_exec('rm this-does-really-not-exist.php 2>&1');
php > echo $res;
rm: Entfernen von „this-does-really-not-exist.php“ nicht möglich: Datei oder
Verzeichnis nicht gefunden
php >
Maybe you drop this requirement "array of...".
/Str.
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
redirect stdout and stderr to PHP variables? crankypuss <no@email.thanks> - 2012-01-25 12:47 -0700
Re: redirect stdout and stderr to PHP variables? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-25 22:42 +0100
Re: redirect stdout and stderr to PHP variables? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-25 22:46 +0100
Re: redirect stdout and stderr to PHP variables? crankypuss <no@email.thanks> - 2012-01-25 15:53 -0700
Re: redirect stdout and stderr to PHP variables? crankypuss <no@email.thanks> - 2012-01-26 01:33 -0700
Re: redirect stdout and stderr to PHP variables? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-26 09:46 +0100
Re: redirect stdout and stderr to PHP variables? crankypuss <no@email.thanks> - 2012-01-26 02:23 -0700
Re: redirect stdout and stderr to PHP variables? Michael Fesser <netizen@gmx.de> - 2012-01-26 14:35 +0100
Re: redirect stdout and stderr to PHP variables? "Peter H. Coffin" <hellsop@ninehells.com> - 2012-01-26 07:49 -0600
Re: redirect stdout and stderr to PHP variables? Tim Streater <timstreater@greenbee.net> - 2012-01-26 09:00 +0000
Re: redirect stdout and stderr to PHP variables? crankypuss <no@email.thanks> - 2012-01-26 02:27 -0700
Re: redirect stdout and stderr to PHP variables? Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-01-26 11:43 +0100
Re: redirect stdout and stderr to PHP variables? crankypuss <no@email.thanks> - 2012-01-26 04:14 -0700
Re: redirect stdout and stderr to PHP variables? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-26 13:25 +0100
Re: redirect stdout and stderr to PHP variables? crankypuss <no@email.thanks> - 2012-01-26 07:11 -0700
Re: redirect stdout and stderr to PHP variables? Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-01-26 16:18 +0100
Re: redirect stdout and stderr to PHP variables? crankypuss <no@email.thanks> - 2012-01-27 03:11 -0700
Re: redirect stdout and stderr to PHP variables? Jerry Stuckle <jstucklex@attglobal.net> - 2012-01-25 17:25 -0500
Re: redirect stdout and stderr to PHP variables? crankypuss <no@email.thanks> - 2012-01-27 03:16 -0700
Re: redirect stdout and stderr to PHP variables? Jerry Stuckle <jstucklex@attglobal.net> - 2012-01-27 08:49 -0500
Re: redirect stdout and stderr to PHP variables? Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-01-27 16:00 +0100
Re: redirect stdout and stderr to PHP variables? Jerry Stuckle <jstucklex@attglobal.net> - 2012-01-27 10:12 -0500
Re: redirect stdout and stderr to PHP variables? "Peter H. Coffin" <hellsop@ninehells.com> - 2012-01-27 10:37 -0600
Re: redirect stdout and stderr to PHP variables? Jerry Stuckle <jstucklex@attglobal.net> - 2012-01-30 21:37 -0500
Re: redirect stdout and stderr to PHP variables? crankypuss <no@email.thanks> - 2012-01-28 05:00 -0700
Re: redirect stdout and stderr to PHP variables? "Peter H. Coffin" <hellsop@ninehells.com> - 2012-01-25 16:52 -0600
Re: redirect stdout and stderr to PHP variables? crankypuss <no@email.thanks> - 2012-01-27 03:22 -0700
Re: redirect stdout and stderr to PHP variables? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-27 12:25 +0100
Re: redirect stdout and stderr to PHP variables? crankypuss <no@email.thanks> - 2012-01-28 05:03 -0700
Re: redirect stdout and stderr to PHP variables? "Peter H. Coffin" <hellsop@ninehells.com> - 2012-01-28 11:40 -0600
Re: redirect stdout and stderr to PHP variables? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-29 00:40 +0100
Re: redirect stdout and stderr to PHP variables? Curtis Dyer <dyer85@gmail.com> - 2012-01-25 22:56 +0000
Re: redirect stdout and stderr to PHP variables? crankypuss <no@email.thanks> - 2012-01-27 03:23 -0700
Re: redirect stdout and stderr to PHP variables? Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-01-27 11:42 +0100
Re: redirect stdout and stderr to PHP variables? Curtis Dyer <dyer85@gmail.com> - 2012-01-29 04:56 +0000
Re: redirect stdout and stderr to PHP variables? [solved] crankypuss <no@email.thanks> - 2012-02-01 05:22 -0700
csiph-web