Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eweka.nl!feeder.eweka.nl!postnews.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!extra.newsguy.com!newsp.newsguy.com!news2 From: crankypuss Newsgroups: comp.lang.php Subject: redirect stdout and stderr to PHP variables? Date: Wed, 25 Jan 2012 12:47:11 -0700 Organization: NewsGuy - Unlimited Usenet $19.95 Lines: 16 Message-ID: NNTP-Posting-Host: pf183072ba85e4752cf8a8c82109b77e93317ac620a6b3f71.newsdawg.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111124 Thunderbird/8.0 Xref: x330-a1.tempe.blueboxinc.net comp.lang.php:4611 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.