#22839 [Opn->Bgs]: Error messages go to STDOUT instead of STDERR
| From: | sniper@php.net | Date: | Mon, 24 Mar 2003 12:33:07 +0000 |
| Subject: | #22839 [Opn->Bgs]: Error messages go to STDOUT instead of STDERR | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-36288@lists.php.net to get a copy of this message | ||
ID: 22839
Updated by: sniper@php.net
Reported By: gk at proliberty dot com
-Status: Open
+Status: Bogus
Bug Type: CGI related
Operating System: linux RH 7.2
PHP Version: 4CVS-2003-03-24 (stable)
New Comment:
Works fine when you have set it correctly in php.ini:
# php -d log_errors=1 -d error_log=/dev/stderr -r "f();" 1>/dev/null
Previous Comments:
------------------------------------------------------------------------
[2003-03-24 02:14:59] gk at proliberty dot com
Error messages should go to /dev/stderr instead of /dev/stdout
Example: redirect STDOUT to /dev/null; notice error message does not
appear below:
[root@p3 php4-STABLE-200303210630]# sapi/cli/php -r "f();" 1>/dev/null
[root@p3 php4-STABLE-200303210630]#
This is what you should see on /dev/stderr:
[root@p3 php4-STABLE-200303210630]# sapi/cli/php -r "f();"
Fatal error: Call to undefined function: f() in Command line code on
line 1
The problem is due to the default error handler; if you install a
custom error handler function with set_error_handler() then you can
work around the problem for errors except the following which CANNOT be
handled with set_error_handler() function:
E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR and
E_COMPILE_WARNING.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22839&edit=1