php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50251 Deprecated php.ini options warnings are not supressable
Submitted: 2009-11-20 20:08 UTC Modified: 2009-11-21 18:11 UTC
From: jd at cpanel dot net Assigned: jani (profile)
Status: Not a bug Package: PHP options/info functions
PHP Version: 5.3.1 OS: Centos 5 AMD64
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: jd at cpanel dot net
New email:
PHP Version: OS:

 

 [2009-11-20 20:08 UTC] jd at cpanel dot net
Description:
------------
This is pretty much a duplicate of bug 49362 which was incorrectly closed.

Jani's fix at revision 288038 doesn't correct the problem.

In a nutshell, it's impossible to configure PHP's error_reporting level so that it doesn't spit out warnings about deprecated php.ini directives at startup.  This is because the warnings are displayed before the error_reporting setting is registered.

Reproduce code:
---------------
root@rh73 [~]# printf "[PHP]\nerror_reporting = E_ALL & ~E_DEPRECATED & ~E_WARNING\nmagic_quotes_gpc = On\n" >~/php.ini
root@rh73 [~]# /usr/bin/php -c/root/ -v
PHP Warning:  Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0
PHP 5.3.1 (cgi-fcgi) (built: Nov 19 2009 18:50:13)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
root@rh73 [~]#


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-20 20:11 UTC] jd at cpanel dot net
Sorry, I don't know how to submit a patch correctly to your BTS.

root@jd:/usr/local/svn/ea/3/branch/easy_test/targz/Cpanel/Easy/PHP5/3_1# cat php5-5.3.1-unsupressable-deprecated-warnings.patch 
diff -Nur php-5.3.1.orig/main/main.c php-5.3.1/main/main.c
--- php-5.3.1.orig/main/main.c  2009-10-28 10:19:32.000000000 -0500
+++ php-5.3.1/main/main.c       2009-11-20 13:30:13.000000000 -0600
@@ -1938,6 +1938,12 @@
                return FAILURE;
        }
 
+       /* Register PHP core ini entries */
+       REGISTER_INI_ENTRIES();
+
+       /* Register Zend ini entries */
+       zend_register_standard_ini_entries(TSRMLS_C);
+
        /* Check for deprecated directives */
        {
                static const char *directives[] = {
@@ -1954,7 +1960,7 @@
 
                while (*p) {
                        if (cfg_get_long((char*)*p, &val) == SUCCESS && val) {
-                               zend_error(E_WARNING, "Directive '%s' is deprecated in PHP 5.3 and greater", *p);
+                               zend_error(E_DEPRECATED, "Directive '%s' is deprecated in PHP 5.3 and greater", *p);
                        }
                        ++p;
                }
@@ -1965,12 +1971,6 @@
                }
        }
 
-       /* Register PHP core ini entries */
-       REGISTER_INI_ENTRIES();
-
-       /* Register Zend ini entries */
-       zend_register_standard_ini_entries(TSRMLS_C);
-
        /* Disable realpath cache if safe_mode or open_basedir are set */
        if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) {
                CWDG(realpath_cache_size_limit) = 0;
 [2009-11-21 15:08 UTC] jani@php.net
It excepted behaviour and will not change. Remove the deprecated options from your ini and it's done.
 [2009-11-21 18:11 UTC] jd at cpanel dot net
Ahh..  Now I see what happened a little better.  Sorry for saying you didn't fix the problem.  You actually did.  I was looking at your trunk commit in 288038 (which doesn't fix the problem but it's not as noticeable since nothing is marked as deprecated for 6.0.)  You committed a working fix to the PHP_5_3 branch in that same revision.

288038 was committed on 04 Sep 2009

The PHP 5.3.1 release branch was created in revision 288008 on 03 September 2009 and your fix was never merged into the release branch, so 5.3.1 and trunk still have this bug.  5.3.2 will have the fix.  Sorry I didn't catch this a during the 5.3.1 RC process.

The only problem that still remains for 5.3.2 is it gives errors about deprecated php.ini directives at the E_WARNING level instead of the E_DEPRECATED level.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC