Re: redirect stdout and stderr to PHP variables? [message #176806 is a reply to message #176804] |
Thu, 26 January 2012 09:23 |
crankypuss
Messages: 147 Registered: March 2011
Karma:
|
Senior Member |
|
|
On 01/26/2012 01:46 AM, M. Strobel wrote:
> Am 26.01.2012 09:33, schrieb crankypuss:
>> On 01/25/2012 03:53 PM, crankypuss wrote:
>>> On 01/25/2012 02:46 PM, M. Strobel wrote:
>>>> php> $res1 = exec('rm this-does-really-not-exist.php 2>&1', $a, $rc);
>>>> php> echo $rc;
>>>> 1
>>>> php> print_r($a);
>>>> Array
>>>> (
>>>> [0] => rm: Entfernen von „this-does-really-not-exist.php“ nicht
>>>> möglich: Datei
>>>> oder Verzeichnis nicht gefunden
>>>> )
>>>> php>
>>>
>>> Thanks, will try these in the morning.
>>
>> BTW, where is this syntax documented? I'd prefer understanding it to using magic.
>
> Hey, I just booted my system in the morning, and checked for news...
>
> see here: http://www.gnu.org/software/bash/manual/bashref.html#Redirections
>
> The windows cmd.exe works quite the same in this point.
>
> /Str.
Sorry, I might be more dense than I realized, but what does bash have to
do with php here? I might not (and often will not) be running a cli
script but rather running commands as part of generating an html page
for a web server.
|
|
|