diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index a09f273a7022..2b4655a47488 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -2065,6 +2065,7 @@ static zend_result php_cli_server_send_error_page(php_cli_server *server, php_cl goto fail; } append_essential_headers(&buffer, client, 1, NULL); + smart_str_appends_ex(&buffer, SAPI_PHP_VERSION_HEADER "\r\n", 1); smart_str_appends_ex(&buffer, "Content-Type: text/html; charset=UTF-8\r\n", 1); smart_str_appends_ex(&buffer, "Content-Length: ", 1); smart_str_append_unsigned_ex(&buffer, php_cli_server_buffer_size(&client->content_sender.buffer), 1); diff --git a/sapi/cli/tests/php_cli_server_013.phpt b/sapi/cli/tests/php_cli_server_013.phpt index 11e3fdf065b1..fb334206908a 100644 --- a/sapi/cli/tests/php_cli_server_013.phpt +++ b/sapi/cli/tests/php_cli_server_013.phpt @@ -127,6 +127,7 @@ HTTP/1.1 404 Not Found Host: %s Date: %s Connection: close +X-Powered-By: PHP/%s Content-Type: text/html; charset=UTF-8 Content-Length: %d @@ -136,6 +137,7 @@ HTTP/1.1 404 Not Found Host: %s Date: %s Connection: close +X-Powered-By: PHP/%s Content-Type: text/html; charset=UTF-8 Content-Length: %d @@ -145,6 +147,7 @@ HTTP/1.1 404 Not Found Host: %s Date: %s Connection: close +X-Powered-By: PHP/%s Content-Type: text/html; charset=UTF-8 Content-Length: %d @@ -153,6 +156,7 @@ HTTP/1.1 405 Method Not Allowed Host: %s Date: %s Connection: close +X-Powered-By: PHP/%s Content-Type: text/html; charset=UTF-8 Content-Length: %d Allow: GET, HEAD, POST @@ -163,6 +167,7 @@ HTTP/1.1 405 Method Not Allowed Host: %s Date: %s Connection: close +X-Powered-By: PHP/%s Content-Type: text/html; charset=UTF-8 Content-Length: %d Allow: GET, HEAD, POST @@ -173,6 +178,7 @@ HTTP/1.1 405 Method Not Allowed Host: %s Date: %s Connection: close +X-Powered-By: PHP/%s Content-Type: text/html; charset=UTF-8 Content-Length: %d Allow: GET, HEAD, POST diff --git a/sapi/cli/tests/php_cli_server_014.phpt b/sapi/cli/tests/php_cli_server_014.phpt index b29a01437399..eb42bf3e8d5b 100644 --- a/sapi/cli/tests/php_cli_server_014.phpt +++ b/sapi/cli/tests/php_cli_server_014.phpt @@ -65,6 +65,7 @@ HTTP/1.1 404 Not Found Host: %s Date: %s Connection: close +X-Powered-By: PHP/%s Content-Type: %s Content-Length: %d