php.net |  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
 [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:
<?php
ini_set('display_errors',1);

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

phpinfo(4);
?>

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-apache=xxx
--with-mysql \
--enable-inline-optimization \
--with-pspell \
--with-gd \
--with-jpeg \
--with-jpeg-dir=/usr/lib \
--with-png \
--with-png-dir=/usr/lib \
--with-zlib





 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-23 05:44 UTC] hholzgra@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC