From 824541d57ecf5514b55b98e392e9d1c30eb38764 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 12 Aug 2020 10:32:05 +0200 Subject: Disable report_zend_debug by default We might just want to drop this completely, but at least don't enable it by default. It already gets disabled by a number of SAPIs, but we should make that the default state. --- main/main.c | 2 +- php.ini-development | 2 +- php.ini-production | 2 +- sapi/cli/php_cli.c | 1 - sapi/litespeed/lsapi_main.c | 1 - sapi/phpdbg/phpdbg.c | 13 +------------ 6 files changed, 4 insertions(+), 17 deletions(-) diff --git a/main/main.c b/main/main.c index 9e0d4ba882..9ac65da922 100644 --- a/main/main.c +++ b/main/main.c @@ -697,7 +697,7 @@ PHP_INI_BEGIN() STD_PHP_INI_BOOLEAN("ignore_repeated_errors", "0", PHP_INI_ALL, OnUpdateBool, ignore_repeated_errors, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("ignore_repeated_source", "0", PHP_INI_ALL, OnUpdateBool, ignore_repeated_source, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("report_memleaks", "1", PHP_INI_ALL, OnUpdateBool, report_memleaks, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN("report_zend_debug", "1", PHP_INI_ALL, OnUpdateBool, report_zend_debug, php_core_globals, core_globals) + STD_PHP_INI_BOOLEAN("report_zend_debug", "0", PHP_INI_ALL, OnUpdateBool, report_zend_debug, php_core_globals, core_globals) STD_PHP_INI_ENTRY("output_buffering", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateLong, output_buffering, php_core_globals, core_globals) STD_PHP_INI_ENTRY("output_handler", NULL, PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateString, output_handler, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("register_argc_argv", "1", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, register_argc_argv, php_core_globals, core_globals) diff --git a/php.ini-development b/php.ini-development index ba30258fd0..b352f5056f 100644 --- a/php.ini-development +++ b/php.ini-development @@ -539,7 +539,7 @@ ignore_repeated_source = Off ; http://php.net/report-memleaks report_memleaks = On -; This setting is on by default. +; This setting is off by default. ;report_zend_debug = 0 ; Turn off normal error reporting and emit XML-RPC error XML diff --git a/php.ini-production b/php.ini-production index a2a22506a4..61960ef807 100644 --- a/php.ini-production +++ b/php.ini-production @@ -543,7 +543,7 @@ ignore_repeated_source = Off ; http://php.net/report-memleaks report_memleaks = On -; This setting is on by default. +; This setting is off by default. ;report_zend_debug = 0 ; Turn off normal error reporting and emit XML-RPC error XML diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 34bf1aee38..d28f5a5378 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -420,7 +420,6 @@ static int php_cli_startup(sapi_module_struct *sapi_module) /* {{{ */ static void sapi_cli_ini_defaults(HashTable *configuration_hash) { zval tmp; - INI_DEFAULT("report_zend_debug", "0"); INI_DEFAULT("display_errors", "1"); } /* }}} */ diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c index 03419d5e97..24703ef75c 100644 --- a/sapi/litespeed/lsapi_main.c +++ b/sapi/litespeed/lsapi_main.c @@ -1219,7 +1219,6 @@ static int cli_main( int argc, char * argv[] ) { static const char * ini_defaults[] = { - "report_zend_debug", "0", "display_errors", "1", "register_argc_argv", "1", "html_errors", "0", diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index c0db5feda5..d817349941 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -1062,17 +1062,6 @@ const char phpdbg_ini_hardcoded[] = "error_log=\n" "output_buffering=off\n\0"; -/* overwritable ini defaults must be set in phpdbg_ini_defaults() */ -#define INI_DEFAULT(name, value) \ - ZVAL_NEW_STR(&tmp, zend_string_init(value, sizeof(value) - 1, 1)); \ - zend_hash_str_update(configuration_hash, name, sizeof(name) - 1, &tmp); - -void phpdbg_ini_defaults(HashTable *configuration_hash) /* {{{ */ -{ - zval tmp; - INI_DEFAULT("report_zend_debug", "0"); -} /* }}} */ - static void phpdbg_welcome(zend_bool cleaning) /* {{{ */ { /* print blurb */ @@ -1567,7 +1556,7 @@ phpdbg_main: phpdbg->name = sapi_name; } - phpdbg->ini_defaults = phpdbg_ini_defaults; + phpdbg->ini_defaults = NULL; phpdbg->phpinfo_as_text = 1; phpdbg->php_ini_ignore_cwd = 1; -- cgit v1.2.1