#22839 [NEW]: Error messages go to STDOUT instead of STDERR
| From: | gk at proliberty dot com | Date: | Mon, 24 Mar 2003 08:14:59 +0000 |
| Subject: | #22839 [NEW]: Error messages go to STDOUT instead of STDERR | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-36235@lists.php.net to get a copy of this message | ||
From: gk at proliberty dot com
Operating system: linux RH 7.2
PHP version: 4CVS-2003-03-24 (stable)
PHP Bug Type: CGI related
Bug description: Error messages go to STDOUT instead of STDERR
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 bug report at http://bugs.php.net/?id=22839&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22839&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=22839&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=22839&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22839&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=22839&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=22839&r=support
Expected behavior: http://bugs.php.net/fix.php?id=22839&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=22839&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=22839&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=22839&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22839&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=22839&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=22839&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=22839&r=gnused