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: errors not displayed if display_startup_error or display_errors is
set to ANY v
In my php.ini file, I have:
display_errors=On
display_startup_errors=On
In Bug #22796, I noted that display_startup_errors=On is required for
proper error display using -r option; however this is a separate problem:
errors not displayed if display_startup_error or display_errors is set to
ANY value, with ini_set() or on the command line
I demonstrate below with -d switch:
[EMAIL PROTECTED] junk]$ php -d display_startup_errors=On -r "f();"
[EMAIL PROTECTED] junk]$ php -d display_startup_errors=Off -r "f();"
[EMAIL PROTECTED] junk]$ php -r "f();"
Fatal error: Call to undefined function: f() in Command line code on line
1
[EMAIL PROTECTED] junk]$ php -d display_errors=Off -r "f();"
[EMAIL PROTECTED] junk]$ php -d display_errors=On -r "f();"
The same problem occurs if call ini_set() instead of using -d option:
#FILE: junk.php
<?php
ini_set("display_errors","On");
ini_set("display_startup_errors","On");
f();
?>
Now, if you use boolean value instead of On/Off, it appears that if EITHER
variable is set to 1, errors work but if EITHER is set to 0, they don't:
[EMAIL PROTECTED] junk]$ php -d display_errors=0 -r "f();"
[EMAIL PROTECTED] junk]$ php -d display_errors=1 -r "f();"
Fatal error: Call to undefined function: f() in Command line code on line
1
[EMAIL PROTECTED] junk]$ php -d display_errors=On -r "f();"
[EMAIL PROTECTED] junk]$ php -d display_startup_errors=1 -r "f();"
Fatal error: Call to undefined function: f() in Command line code on line
1
[EMAIL PROTECTED] junk]$ php -d display_startup_errors=0 -r "f();"
[EMAIL PROTECTED] junk]$
--
Edit bug report at http://bugs.php.net/?id=22844&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22844&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=22844&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=22844&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22844&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=22844&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=22844&r=support
Expected behavior: http://bugs.php.net/fix.php?id=22844&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=22844&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=22844&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=22844&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22844&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=22844&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=22844&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=22844&r=gnused