php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48402 PHP stopped reporting errors
Submitted: 2009-05-27 02:20 UTC Modified: 2009-06-03 21:17 UTC
From: aaron dot chmelik at gmail dot com Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 5.2.9 OS: Mac OSX 10.5.6
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: aaron dot chmelik at gmail dot com
New email:
PHP Version: OS:

 

 [2009-05-27 02:20 UTC] aaron dot chmelik at gmail dot com
Description:
------------
PHP has ceased reporting any errors. I recently installed the GD libs, but haven't made any changes to the error reporting in the php.ini file, any changes to httpd.conf for error reporting or .htaccess at all (recently). I am running PHP 5.2.9 on Mac OSX 10.5.6 with Apache 2.2.9. I would provide a URL for replicating the issue, but I am running PHP on a local system, and am ignoring all outside requests to apache.

I ran phpinfo(), the error_reporting value is 6143 (E_ALL)

Reproduce code:
---------------
<?php

require("dbconnect.php"); //this file does not exist

$test = mysql_query("SELECT * FROM applicants WHERE this = 'test'"); //again, does not exist

if(!$test){
echo "Error";
}

while($testdisp = mysql_fetch_array($test)){
echo $testdisp['this'];
}


?>



Expected result:
----------------
It should give me an error that the file doesn't exist. I have tested this with a number of errors, both non-fatal and fatal, and have received NO results

Actual result:
--------------
If I don't comment out the require line, I get the word "Error" echoed from my scripted error checking. If I don't comment out the require line, I get a blank page. I don't get any errors from PHP. 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-27 10:09 UTC] jani@php.net
Check your display_errors and error_log settings too.
 [2009-05-29 15:15 UTC] aaron dot chmelik at gmail dot com
display_errors = On
log_errors = Off
also,
error_reporting = E_ALL
error_log = php_errors.log

I changed log_errors to On, restarted Apache, with the same results. Would also like to mention that my original post should have said "If I comment out the require line, I get the word "Error" echoed from my scripted error checking."

Just showing the difference in how fatal and non-fatal errors are being treated.

I would also like to note that since I've turned on log_errors, nothing has been logged to the file.
 [2009-06-02 08:00 UTC] jani@php.net
Try running the same script on command line (using either php-cgi or php  
CLI binary). Like this:

# php -n test.php

 [2009-06-02 18:47 UTC] aaron dot chmelik at gmail dot com
Error reporting worked perfect when run in the command line.
 [2009-06-02 21:55 UTC] jani@php.net
Now check and double check your configuration under Apache by running <?
php phpinfo(); ?> in same directory where the problematic script is. 
Check all error reporting and logging settings values. I bet you have 
somewhere in the path some .htaccess file or somewhere in your 
httpd.conf where error reporting is disabled..
 [2009-06-02 23:05 UTC] aaron dot chmelik at gmail dot com
I missed this before:

display_errors: Off

This is both for local value and master value. I've checked my php.ini, httpd.conf, and .htaccess files. .htaccess doesn't seem to have anything on errors, httpd.conf and php.ini both have display_errors = On
 [2009-06-03 21:17 UTC] jani@php.net
Obviously this isn't bug, just bad configuration. Check what php.ini is 
actually loaded (also mentioned in phpinfo() output) and possibly some 
additional .ini parts.
 [2011-04-24 01:29 UTC] aosmith at gmail dot com
I have to agree with aaron.  I'm having a similar problem in 10.6.7 and php 
5.3.4.  From phpinfo():

display_errors		On		On
display_startup_errors	On		On
doc_root		no value	no value
docref_ext		no value	no value
docref_root		no value	no value
enable_dl	Off	Off
error_append_string	no value	no value
error_log		no value	no value
error_prepend_string	no value	no value
error_reporting	32767	32767
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 16:01:31 2024 UTC