ID:               50251
 User updated by:  jd at cpanel dot net
 Reported By:      jd at cpanel dot net
 Status:           Open
 Bug Type:         *Configuration Issues
 Operating System: Centos 5 AMD64
 PHP Version:      5.3.1
 New Comment:

Sorry, I don't know how to submit a patch correctly to your BTS.

r...@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;


Previous Comments:
------------------------------------------------------------------------

[2009-11-20 20:08:45] 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:
---------------
r...@rh73 [~]# printf "[PHP]\nerror_reporting = E_ALL & ~E_DEPRECATED &
~E_WARNING\nmagic_quotes_gpc = On\n" >~/php.ini
r...@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
r...@rh73 [~]#



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=50251&edit=1

Reply via email to