diff --git a/main/main.c b/main/main.c index 367c92ae8a3..4ea14444c5d 100644 --- a/main/main.c +++ b/main/main.c @@ -129,12 +129,14 @@ static PHP_INI_MH(OnSetPrecision) static PHP_INI_MH(OnChangeMaxExecutionTime) { int new_timeout; + PLS_FETCH(); if (new_value) { new_timeout = atoi(new_value); } else { new_timeout = 0; } + PG(max_execution_time) = new_timeout; php_set_timeout(new_timeout); return SUCCESS; } @@ -740,6 +742,8 @@ int php_request_startup(CLS_D ELS_DC PLS_DC SLS_DC) zend_activate(CLS_C ELS_CC); sapi_activate(SLS_C); + php_set_timeout(PG(max_execution_time)); + if (PG(output_buffering)) { php_start_ob_buffering(); } diff --git a/main/php_globals.h b/main/php_globals.h index 44c8cbbf055..b11f8a7816e 100644 --- a/main/php_globals.h +++ b/main/php_globals.h @@ -89,6 +89,8 @@ struct _php_core_globals { short connection_status; short ignore_user_abort; + long max_execution_time; + unsigned char header_is_being_sent; zend_llist ll_post_request_startup;