php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32707 error_reporting turned off in php.ini and on by ini_set give no error output
Submitted: 2005-04-14 21:36 UTC Modified: 2005-04-14 22:02 UTC
From: ion at in-dev dot de Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.3 OS: Linux/Windows
Private report: No CVE-ID: None
 [2005-04-14 21:36 UTC] ion at in-dev dot de
Description:
------------
Ok starting,
hope you can understand my bad english :)

Take a script like:
<?php
echo "bogus line;
?>

With enabled error_reporting and display_errors by php.ini PHP gives a parse error. Turn those two configuration vars off gives you no output. So far so good...
Change the script to:

<?php
ini_set('display_errors',1);
ini_set('error_reporting',E_ALL);

echo "bogus line;
?>

Now PHP should give a parse error, too. Right?!
But PHP give no output. Only with the command line cgi version and the parameter -l it tells about a parsing error.
I have reproduce this on Linux and Windows with PHP 5.0.3 .

Regards Kai


Reproduce code:
---------------
<?php
// turn error_reporting and display_errors off in php.ini
// php should give a error reporting to, enabled by the
// following lines
ini_set('display_errors',1);
ini_set('error_reporting',E_ALL);

echo "bogus line;
?>

Expected result:
----------------
Parse error: parse error, unexpected $ in /root/phptest/bogus.php on line 9


Actual result:
--------------
no output

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-14 22:02 UTC] derick@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

Parse errors are thrown before your script (and thus also your ini_set() lines) starts executing... so it never resets them. You need a .htaccess file or modify php.ini for this.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 28 19:00:02 2025 UTC