#22796 [NEW]: fatal messages go to stdout; to /dev/null with -r option
| From: | gk at proliberty dot com | Date: | Thu, 20 Mar 2003 00:42:56 +0000 |
| Subject: | #22796 [NEW]: fatal messages go to stdout; to /dev/null with -r option | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-36000@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-19 (stable)
PHP Bug Type: CGI related
Bug description: fatal messages go to stdout; to /dev/null with -r option
I'm using php4-STABLE-200303191630
Problem is with sapi/cli/php
The problem has TWO, possibly related parts:
1. when cli/php is invoked with script argument, FATAL error messages go
to /dev/stdout instead of /dev/stderr, making it difficult to handle
errors properly
2. when cli/php is invoked with -r '...' option, error messages are lost
ENTIRELY, although output preceding the fatal command is not.
//test.php
<?php
echo "begin\n";
f(); // undefined function; fatal error
echo "end\n";
?>
#OUTPUT OF SCRIPT:
[greg@p3 junk]$ php "test.php"
begin
Fatal error: Call to undefined function: f() in
/usr/local/apache/htdocs/common/test/junk/test.php on line 3
[greg@p3 junk]$ php "test.php" 1>/dev/null
[greg@p3 junk]$ php -r 'require "test.php";'
begin
[greg@p3 junk]$
--
Edit bug report at http://bugs.php.net/?id=22796&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22796&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=22796&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=22796&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22796&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=22796&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=22796&r=support
Expected behavior: http://bugs.php.net/fix.php?id=22796&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=22796&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=22796&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=22796&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22796&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=22796&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=22796&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=22796&r=gnused