#48275 [Bgs]: write errors to STDERR, by default
ID: 48275
User updated by: jidanni at jidanni dot org
Reported By: jidanni at jidanni dot org
Status: Bogus
Bug Type: Scripting Engine problem
PHP Version: 5.2.9
New Comment:
You need to patch as follows, as this is a man page for the command
line usage, and there is no other command line program in UNIX that
behaves like you do.
--- php5.1.orig 2009-05-15 19:30:05.000000000 +0800
+++ php5.1 2009-05-15 19:38:27.532490080 +0800
@@ -348,6 +348,8 @@
certain input lines with your code. But note that in such cases $argi
only
counts the lines being processed by php itself. Having read this you
will
guess what the above program does: skipping every second input line.
+.SH ERROR REPORTING
+Use -d display_errors=stderr if one wants errors written to standard
error.
.SH TIPS
You can use a shebang line to automatically invoke php
from scripts. Only the CLI version of PHP will ignore
Previous Comments:
------------------------------------------------------------------------
[2009-05-14 12:35:16] jani@php.net
You can set this without display_errors ini directive to whatever you
want. This is not a bug. (see http://php.net/display_errors )
------------------------------------------------------------------------
[2009-05-14 07:14:12] jidanni at jidanni dot org
Description:
------------
I can't believe that PHP writes its error messages to STDOUT by
default
instead of STDERR. (At least you don't have them BOTH reversed.)
$ php lyrics.php |colrm 77
Warning: Unexpected character in input: ''' (ASCII=39) state=1 in
Parse error: syntax error, unexpected ')' in /home/jidanni/audio/
$ php -r WRONG
Parse error: syntax error, unexpected $end in Command line code on line
1
At least on the _man page_ mention you are doing it on purpose because
you fear it will flood some log or something.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48275&edit=1
Thread (4 messages)