From 1f3379182d441ac17bdd54af9e5b0162dd5c70fe Mon Sep 17 00:00:00 2001 From: ndossche <7771979+ndossche@users.noreply.github.com> Date: Mon, 26 Oct 2026 00:07:20 +0100 Subject: [PATCH 1/2] Fix GH-24697: cli: passing PHP_HTTP_PARSER_STRICT build option doesn't work The default is non-strict, we need to keep the default for BC reasons. We change the macro handling such that it can be enabled now, previously it couldn't be enabled. --- sapi/cli/php_http_parser.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sapi/cli/php_http_parser.h b/sapi/cli/php_http_parser.h index 345ca405edd0..624474eabe3d 100644 --- a/sapi/cli/php_http_parser.h +++ b/sapi/cli/php_http_parser.h @@ -36,12 +36,10 @@ extern "C" { #include -/* Compile with -DPHP_HTTP_PARSER_STRICT=0 to make less checks, but run - * faster +/* Compile with -DPHP_HTTP_PARSER_STRICT=1 to enable more checks, but run + * slower */ #ifndef PHP_HTTP_PARSER_STRICT -# define PHP_HTTP_PARSER_STRICT 1 -#else # define PHP_HTTP_PARSER_STRICT 0 #endif From cc2d92dc54f35652cf62a1422817e0e14e4e9410 Mon Sep 17 00:00:00 2001 From: ndossche <7771979+ndossche@users.noreply.github.com> Date: Mon, 26 Oct 2026 18:29:20 +0100 Subject: [PATCH 2/2] Fix Co-authored-by: David Carlier --- sapi/cli/php_http_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/cli/php_http_parser.c b/sapi/cli/php_http_parser.c index c7c2ad0caaea..252c5fcf7598 100644 --- a/sapi/cli/php_http_parser.c +++ b/sapi/cli/php_http_parser.c @@ -244,7 +244,7 @@ enum flags #define start_state (parser->type == PHP_HTTP_REQUEST ? s_start_req : s_start_res) -#ifdef HTTP_PARSER_STRICT +#if HTTP_PARSER_STRICT # define STRICT_CHECK(cond) if (cond) goto error # define NEW_MESSAGE() (http_should_keep_alive(parser) ? start_state : s_dead) #else