[php-src] master: Merge branch 'PHP-8.6'

From: Date: Tue, 22 Sep 2026 15:42:13 +0000
Subject: [php-src] master: Merge branch 'PHP-8.6'
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-141446@lists.php.net to get a copy of this message
Author: ndossche (ndossche) Date: 2026-09-22T17:42:01+02:00 Commit: https://github.com/php/php-src/commit/b52ab901b5f54e681c01609e18575a9550574840 Raw diff: https://github.com/php/php-src/commit/b52ab901b5f54e681c01609e18575a9550574840.diff Merge branch 'PHP-8.6' * PHP-8.6: Fix GH-23764: Built-in server leaks fd on HEAD request for static file [ci skip] Update NEWS for 8.6.0RC2 Changed paths: M sapi/cli/php_cli_server.c Diff: diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 9ccee510bb2c..485da7920360 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -2227,6 +2227,11 @@ static zend_result php_cli_server_begin_send_static(php_cli_server *server, php_ client->content_sender_initialized = true; if (client->request.request_method != PHP_HTTP_HEAD) { client->file_fd = fd; + } else { + /* Content-Length comes from the stat and no body is sent, so the fd is + not needed; it is still opened so HEAD gets the same 404 as GET on + an unreadable file. */ + close(fd); } {

« previous php.cvs (#141446) next »