Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

sqldatasource dal, wwwxxxenden, convert raid5 to raid 10 mdadm, apache force chunked, nrao wwwxxx, xxxxxdup, procmail change subject header, wwwXxx not20, Wwwxxx.doks sas, linux raid resync after reboot

Links

XODOX
Impressum

#1: Re: STDOUT and STDERR with php.exe and php-win.exe on Win XP

Posted on 2011-06-20 18:27:23 by Richard Quadling

On 20 June 2011 18:18, JDS <jds@forerunnertv.com> wrote:
> I am trying to figure out how this all works on Win XP...
>
> When I call php.exe or php-win.exe from another script (AutoHotKey in my
> case), do both of these programs use stdout and stderr? I know php.exe has a
> console window and php-win.exe does not, but just need to know how they
> output the results.
>
> Thanks

STDOUT is the normal output for php.exe.

To write to the STDERR, you can ...

php -r "file_put_contents('php://STDERR', 'This is an error');" >
PHP_STDOUT.txt 2> PHP_STDERR.txt

2011-06-20 17:26 16 PHP_STDERR.txt
2011-06-20 17:26 0 PHP_STDOUT.txt

OOI. If you want to use PHP scripts to act as a filter. E.g.

command | php script, then read
http://docs.php.net/manual/en/install.windows.commandline.ph p

--
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Report this message

#2: STDOUT and STDERR with php.exe and php-win.exe on Win XP

Posted on 2011-06-20 19:18:56 by jds

I am trying to figure out how this all works on Win XP...

When I call php.exe or php-win.exe from another script (AutoHotKey in my case), do both of
these programs use stdout and stderr? I know php.exe has a console window and php-win.exe
does not, but just need to know how they output the results.

Thanks

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Report this message

#3: Re: STDOUT and STDERR with php.exe and php-win.exe on WinXP

Posted on 2011-06-21 00:06:31 by jds

On 6/20/2011 11:27 AM, Richard Quadling wrote:
> On 20 June 2011 18:18, JDS<jds@forerunnertv.com> wrote:
>> I am trying to figure out how this all works on Win XP...
>>
>> When I call php.exe or php-win.exe from another script (AutoHotKey in my
>> case), do both of these programs use stdout and stderr? I know php.exe has a
>> console window and php-win.exe does not, but just need to know how they
>> output the results.
>>
>> Thanks
> STDOUT is the normal output for php.exe.
>
> To write to the STDERR, you can ...
>
> php -r "file_put_contents('php://STDERR', 'This is an error');">
> PHP_STDOUT.txt 2> PHP_STDERR.txt
>
> 2011-06-20 17:26 16 PHP_STDERR.txt
> 2011-06-20 17:26 0 PHP_STDOUT.txt
>
> OOI. If you want to use PHP scripts to act as a filter. E.g.
>
> command | php script, then read
> http://docs.php.net/manual/en/install.windows.commandline.ph p
>
What about php-win.exe? Does it write to STDOUT as well even though there is no console
window?

Thanks

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Report this message

#4: Re: STDOUT and STDERR with php.exe and php-win.exe on Win XP

Posted on 2011-06-21 13:26:13 by Richard Quadling

On 20 June 2011 23:27, JDS <jds@forerunnertv.com> wrote:
> On 6/20/2011 11:27 AM, Richard Quadling wrote:
>>
>> On 20 June 2011 18:18, JDS<jds@forerunnertv.com> àwrote:
>>>
>>> I am trying to figure out how this all works on Win XP...
>>>
>>> When I call php.exe or php-win.exe from another script (AutoHotKey in m=
y
>>> case), do both of these programs use stdout and stderr? I know php.exe
>>> has a
>>> console window and php-win.exe does not, but just need to know how they
>>> output the results.
>>>
>>> Thanks
>>
>> STDOUT is the normal output for php.exe.
>>
>> To write to the STDERR, you can ...
>>
>> php -r "file_put_contents('php://STDERR', 'This is an error');">
>> PHP_STDOUT.txt 2> àPHP_STDERR.txt
>>
>> 2011-06-20 à17:26 à à à à à à à =
à16 PHP_STDERR.txt
>> 2011-06-20 à17:26 à à à à à à à =
à 0 PHP_STDOUT.txt
>>
>> OOI. If you want to use PHP scripts to act as a filter. E.g.
>>
>> command | php script, then read
>> http://docs.php.net/manual/en/install.windows.commandline.ph p
>>
> What about php-win.exe? Does it write to STDOUT as well even though there=
is
> no console window?
>
> Thanks

Running ...

php-win -r "echo file_put_contents('php://STDERR', 'This is an error');"

outputs nothing.

Same command with outputs redirected ...

php-win -r "echo file_put_contents('php://STDERR', 'This is an
error');" > STDOUT.txt 2>STDERR.txt

outputs the 2 text files - the content of STDOUT.txt is 16.

So, you can capture STDOUT and STDERR and NOT have a console box.

Richard.

--=20
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Report this message