php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61356 error_reporting always reports E_STRICT
Submitted: 2012-03-12 09:28 UTC Modified: 2014-02-02 23:11 UTC
From: dave dot kimble at gmx dot com Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 5.4.0 OS: Windows 7 Ult 32
Private report: No CVE-ID: None
 [2012-03-12 09:28 UTC] dave dot kimble at gmx dot com
Description:
------------
php-5.4.0-Win32-VC9-x86.zip downloaded 11 March 2012
php.ini as per php.ini-production with a few minor tweaks
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
sends E_STRICT messages to web page - potential security risk

eg: Strict Standards: Non-static method ConvertUtils::AttributeQuote() should not be called statically in W:\domains\*****.org.au\private_html\webmail\index.php on line 226

Nothing I do to error_reporting will switch it off.
display_errors = Off doesn't seem to work either.




Test script:
---------------
AfterLogic Webmail http://www.afterlogic.com/download/webmail_php.zip
unzip to /webmail and browse to /webmail/install
needs MySQL, installs OK, 
then browse to /webmail/index.php to login
login screens fills with E_STRICT messages and the form gets corrupted


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-12 18:52 UTC] nikic@php.net
Are you sure that you are modifying the correct .ini file? Also, did you restart your server after the changes?
 [2012-03-12 21:04 UTC] dave dot kimble at gmx dot com
Yes, the correct file was identified by phpinfo as C:/PHP/php.ini .
Yes, the web server was restarted afterwards.
I also inserted error_reporting into /webmail/index.php to no effect.
The PHP manual notes changes on error_reporting with various versions,
but I have been unable to discover any changes with v5.4.0 .

Versions:
OS: Windows 7 Ult 32-bit
Web Server: Fastream IQ 11.5.5R
PHP: 5.4.0 VC9 Threadsafe
OpenSSL 0.9.8.20
SQL Server: MySQL 5.5.21
Mail Server: hMailServer 5.3.3-B1879
WebMail: AfterLogic 6.3.10
 [2012-03-12 21:45 UTC] pajoye@php.net
create a phpinfo.php with:

<?php
phpinfo();

and check the ini settings. If it is the same than in your php.ini ("loaded 
php.ini tells you which is loaded), then your app changes them somewhere.
 [2012-03-12 21:45 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2012-03-13 01:10 UTC] dave dot kimble at gmx dot com
Yes, the correct file was identified by phpinfo as C:/PHP/php.ini .
Yes, the web server was restarted afterwards.
I also inserted error_reporting into /webmail/index.php to no effect.

If I add a line 2 to /webmail/index.php :
<?php
error_reporting(0);

and it meets other error_reporting() functions in included files,
does the scope of the new error reporting extend to index.php ?

I see a change has been added to http://php.net/manual/en/function.error-reporting.php for v5.4.0 making E_STRICT part of E_ALL.
So there has been a change in this very area where I am finding a problem.
 [2012-03-13 01:10 UTC] dave dot kimble at gmx dot com
-Status: Feedback +Status: Open
 [2012-03-13 01:35 UTC] rasmus@php.net
You are missing something here. This works fine for everyone else. Hard to tell 
from here what it is though.
 [2012-03-13 03:36 UTC] dave dot kimble at gmx dot com
Here is a test script:
<?php 
echo (
'script = ' . $_SERVER['SCRIPT_NAME'] . '<BR>' .
'php ini loaded = ' . php_ini_loaded_file() . '<BR>' .
'error_reporting = ' . ini_get('error_reporting') . '<BR>' .
'display_errors = ' . ini_get('display_errors') . '<BR>' . 
'end');
?>

Here is the output:
script = /webmail/test.php
php ini loaded = C:\PHP\php.ini
error_reporting = 22527
display_errors =
end 

22527 = (32767 - 8192 - 2048) = E_ALL & ~E_DEPRECATED & ~E_STRICT
so something is the matter with error_reporting because E_STRICT messages ARE appearing.
The display_errors is WRONG because in C:\PHP\php.ini it is set to:
display_errors = Off

The php.ini file is at http://www.peakoil.org.au/php.ini
 [2012-03-14 01:42 UTC] dave dot kimble at gmx dot com
-Status: Open +Status: Closed
 [2012-03-14 01:42 UTC] dave dot kimble at gmx dot com
AfterLogic say they are very sorry and their code DOES contain error_reporting in 2 scripts for debug purposes that should be commented out.

Sorry to waste your time.
CLOSED
 [2012-03-14 01:45 UTC] aharvey@php.net
-Status: Closed +Status: Not a bug
 [2012-03-14 01:45 UTC] aharvey@php.net
No worries, thanks.
 [2014-02-02 15:56 UTC] hc dot stoellinger at aon dot at
Hello, 
I experience exactly this bug under PHP 5.8.1 (Linux-Mint-Petra). Is there some patch for it?
Regards
H. Stoellinger
Salzburg
 [2014-02-02 23:11 UTC] requinix@php.net
@hc.stoellinger
Read the comments: there never was a bug. Check your php.ini and code because somewhere you've told PHP to include E_STRICT and/or display error messages.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 01:01:28 2024 UTC