diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index 4982a740d4b..ae9727700d6 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -487,6 +487,8 @@ static int php_handler(request_rec *r) ap_add_cgi_vars(r); } +zend_first_try { + ctx = SG(server_context); if (ctx == NULL) { ctx = SG(server_context) = apr_pcalloc(r->pool, sizeof(*ctx)); @@ -556,6 +558,8 @@ static int php_handler(request_rec *r) ctx->r = parent_req; } +} zend_end_try(); + return OK; }