php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49362 Deprecated php.ini options warnings output even with display_errors=off
Submitted: 2009-08-25 16:11 UTC Modified: 2010-03-23 14:26 UTC
From: tomas dot hlavacek at firma dot volny dot cz Assigned: kalle (profile)
Status: Closed Package: PHP options/info functions
PHP Version: 5.3, 6 OS: *
Private report: No CVE-ID: None
 [2009-08-25 16:11 UTC] tomas dot hlavacek at firma dot volny dot cz
Description:
------------
I'm running php 5.3.0 under IIS 7 (Windows Web Server 2008) as Fast-CGI module. 

Setting directive register_long_arrays=On results in "HTTP Error 500.0 - Internal Server Error".
 
Look's like Warning message "PHP Warning:  Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in Unknown on line 0" is sent from php to IIS before any headers and cannot be suppressed in any way. This warning seems to be ignoring any error reporting settings in php.ini.

Turning this directive Off is not a solution for now. Many of our customers have to change their php scripts first.

Reproduce code:
---------------
E.G.

<? phpinfo(); ?>

Expected result:
----------------
phpinfo() page

Actual result:
--------------
HTTP Error 500.0 - Internal Server Error
D:\php5\php-cgi.exe - The FastCGI process exited unexpectedly

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-26 07:57 UTC] tomas dot hlavacek at firma dot volny dot cz
Just tried 5.3.1-dev (VC9 thread safe). Same result.
Changing error reporting settings in php.ini doesn't affect showing that warning message.
 [2009-08-26 09:02 UTC] jani@php.net
Are you sure you really updated everything? And to turn it off, just remove E_DEPRECATED from your error_reporting.
 [2009-08-26 09:10 UTC] tomas dot hlavacek at firma dot volny dot cz
Yes, I'm pretty sure to have everything updated :)

php.ini:
error_reporting = E_ALL & ~E_DEPRECATED
display_errors = On

Even if I change display_errors=Off, that message will appear.


Take a look at this output:

D:\php5>php --ini
PHP Warning:  Directive 'register_long_arrays' is deprecated in PHP 5.3 and grea
ter in Unknown on line 0
Configuration File (php.ini) Path: C:\Windows
Loaded Configuration File:         D:\php5\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)


For me, that warning message seems to be hardcoded in php source. Please revise your code.
 [2009-08-26 09:52 UTC] jani@php.net
Assigning to Kalle who added these in the obviously wrong place. Deprecated ini settings checks can not happen in place where a check for removed setting is done!
 [2009-08-26 09:59 UTC] tomas dot hlavacek at firma dot volny dot cz
Yes, true. What Error Level Constant is used for showing deprecated ini settings then?
 [2009-08-26 11:08 UTC] jani@php.net
And in HEAD these should be E_FATAL errors.
 [2009-08-26 11:08 UTC] jani@php.net
Correction: E_ERROR of course. :)
 [2009-09-02 16:25 UTC] romanf at trash dot net
Will this be fixed in 5.3? Or only in 6?

-Roman
 [2009-09-03 21:26 UTC] jani@php.net
For 6: change the error reporting to E_ERROR
For 5.3: change them to E_DEPRECATED (and only really shown when that is 
set)
 [2009-09-04 11:03 UTC] jani@php.net
Fixed.
 [2009-09-07 07:20 UTC] tomas dot hlavacek at firma dot volny dot cz
php.ini:
error_reporting = E_ALL & ~E_DEPRECATED
display_errors = On

php -i output:
~~~~~~
D:\php5>php -i

Warning: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in Unknown on line 0
phpinfo()
PHP Version => 5.3.2-dev

System => Windows NT W2K8-TEST 6.0 build 6002 (Windows Server 2008 Web Server Edition Service Pack 2) i586
...
~~~~~~

Is this desired manner?
 [2009-09-07 08:42 UTC] jani@php.net
Yes. It's not E_DEPRECATED, it's E_WARNING and that's not gonna change.
 [2009-09-07 08:54 UTC] tomas dot hlavacek at firma dot volny dot cz
Check what you wrote:

[3 Sep 9:26pm UTC] jani@php.net

For 6: change the error reporting to E_ERROR
For 5.3: change them to E_DEPRECATED (and only really shown when that is

set)


That's confusing then...
 [2010-03-23 14:03 UTC] aks at esoft dot dk
> That's confusing then...

Not to mention it contradicts the documentation 
(http://www.php.net/manual/en/migration53.deprecated.php):

"The following is a list of deprecated INI directives. Use of any of these INI 
directives will cause an E_DEPRECATED error to be thrown at startup.
(...)
 * register_long_arrays
(...)"

No it doesn't. It throws E_WARNING, just like when trying to copy a non-existant 
file. Except in 5.3.0 and 5.3.1 where even error_reporting=0 in your INI wont 
kill the message.

I have an idea in the spirit of PHP's design philosophy -- why not disable the 
warning if you write it your php.ini as follows?

@register_long_arrays = On

:-D
D-:
 [2010-03-23 14:26 UTC] kalle@php.net
aks at esoft dot dk > If the documentation indeed says that, then report it as a separate issue instead of bumping an already closed report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 03:01:32 2024 UTC