Re: redirect stdout and stderr to PHP variables? [message #176817 is a reply to message #176799] |
Wed, 25 January 2012 22:52 |
Peter H. Coffin
Messages: 245 Registered: September 2010
Karma:
|
Senior Member |
|
|
On Wed, 25 Jan 2012 12:47:11 -0700, crankypuss wrote:
> 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.
Sorry, you have to use the file, then read the file if you want to parse
back in what went out on stderr.
--
85. I will not use any plan in which the final step is horribly
complicated, e.g. "Align the 12 Stones of Power on the sacred altar
then activate the medallion at the moment of total eclipse."
Instead it will be more along the lines of "Push the button."
|
|
|