php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48583 display_errors=off setting won't stop some errors
Submitted: 2009-06-17 13:51 UTC Modified: 2009-06-18 14:35 UTC
From: dmda at yandex dot ru Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.3.0RC3 OS: Windows XP sp3
Private report: No CVE-ID: None
 [2009-06-17 13:51 UTC] dmda at yandex dot ru
Description:
------------
display_errors=off setting won't stop some errors from appearing in the output.

Any errors thrown by modules at the initialization phase shoud be accumulated somewhere, not passed to the output directly.
In partcilar, if you have an error in php.ini, display_errors=OFF won't have any effect.

Reproduce code:
---------------
php.ini:
=======================================
error_reporting=E_ALL | E_DEPRECATED
error_log="D:\php-5.3RC3-Win32\php.log"
log_errors=On
display_errors=Off
#something
;a comment
=======================================

command line:
=======================================
php-cgi.exe -i >somefile.html
=======================================


Expected result:
----------------
nothing in the output

Actual result:
--------------
2 errors appeared on screen:

PHP Deprecated:  Comments starting with '#' are deprecated in D:\php-5.3RC3-Win32\php.ini on line 5
in Unknown on line 0

PHP Warning:  Unknown: It is not safe to rely on the system's timezone settings. You are *required*
to use the date.timezone setting or the date_default_timezone_set() function. In case you used any o
f those methods and you are still getting this warning, you most likely misspelled the timezone iden
tifier. We selected 'Europe/Moscow' for '4.0/DST' instead in Unknown on line 0


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-17 14:18 UTC] pajoye@php.net
"PHP Deprecated:  Comments starting with '#' are deprecated in
D:\php-5.3RC3-Win32\php.ini on line 5
in Unknown on line 0"

Now I see what you meant. I did not even know that it was deprecated in php.ini (but still no crash with vc9-nts or ts).


 [2009-06-18 13:51 UTC] jani@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 [2009-06-18 14:35 UTC] dmda at yandex dot ru
Jani,
Enen though it is documented and is considered "fine", there is nothing fine with this.
Try to drive a car with non fixable doors. It may be also well-documented and properly explained, and what? Does it finally help?

Display_errors is a self-explanatory thing. It must work as it sounds. If it does not, this is a bug.

BTW, it's very simple to implement a list where all the errors thrown before compile-time will be accumulated. The list could be flushed at once as soon as php is ready, that's when all the settings are parsed and loaded. In this case all the errors will be properly routed to the log files and not to display (according to the settings). Isn't it a NORMAL behaviour all php developers and administrators would expect?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 10:01:28 2024 UTC