|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17371 ini_set('display_errors',1) does not display parse errors
Submitted: 2002-05-22 17:44 UTC Modified: 2002-05-23 05:44 UTC
From: jbearer at pittsburghlive dot com Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 4.2.1 OS: RedHat 7.2 2.4.9 kernel
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jbearer at pittsburghlive dot com
New email:
PHP Version: OS:


 [2002-05-22 17:44 UTC] jbearer at pittsburghlive dot com
When display_errors is set to off in the php.ini file and I turn it back on with ini_set. it displays fatal errors like missing functions, but not parse errors like missing quotes.

from php.ini file:
error_reporting  =  E_ALL & ~E_NOTICE
display_errors = Off
display_startup_errors = Off
log_errors = On
error_log = "/tmp/php.log"

Test Script:

# echo "dfadf"asdf;
# missingfunction();


Run the script as is and the variables in phpinfo all look a-ok, display_errors is set to "On" locally. 

Uncomment the echo line and it logs the error to the file but does not display the error. The kind of error is a parse error.

Now try the missingfunciton line,  it logs the error to the file and displays the error to the screen, the desired action. The kind of error is a fatal error.

Confiure for my PHP is:
--with-mysql \
--enable-inline-optimization \
--with-pspell \
--with-gd \
--with-jpeg \
--with-jpeg-dir=/usr/lib \
--with-png \
--with-png-dir=/usr/lib \



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-23 05:44 UTC]
your scripts are parsed *before* execution,
so the parse error occures before your
ini_set() call is executed and takes effect,
and ini_set() will never be called as a script
with parse errors in it will not be executed
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Jan 19 21:03:36 2022 UTC