Problem
CGI/FastCGI deployments and frameworks expect $_SERVER['SERVER_PROTOCOL'] (typically HTTP/1.1). Dev server and Superglobals::populateServer() set GATEWAY_INTERFACE but do not populate SERVER_PROTOCOL, so portable code like:
if (($_SERVER['SERVER_PROTOCOL'] ?? '') === 'HTTP/1.1') { /* ... */ }
behaves differently under phpc serve than under PHP-FPM.
Blocks #50 CGI driver parity and #173 FastCGI adapter.
Goal
Set $_SERVER['SERVER_PROTOCOL'] from the parsed HTTP request line in DevServer and from CGI env when present. AOT refresh copies env through superglobals_refresh.c.
Scope
Acceptance criteria
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
./script/ci-local.sh --filter web_server_protocol
Fixture echoes HTTP/1.1 when served via phpc serve.
Verification (local / Docker only)
No .github/workflows/* changes required.
Dependencies
Links
Problem
CGI/FastCGI deployments and frameworks expect
$_SERVER['SERVER_PROTOCOL'](typicallyHTTP/1.1). Dev server andSuperglobals::populateServer()setGATEWAY_INTERFACEbut do not populateSERVER_PROTOCOL, so portable code like:behaves differently under
phpc servethan under PHP-FPM.Blocks #50 CGI driver parity and #173 FastCGI adapter.
Goal
Set
$_SERVER['SERVER_PROTOCOL']from the parsed HTTP request line inDevServerand from CGI env when present. AOT refresh copies env throughsuperglobals_refresh.c.Scope
lib/Web/DevServer.php— parseHTTP/1.1from request line;putenv('SERVER_PROTOCOL=...')lib/Web/Superglobals.php—populateServer()readsSERVER_PROTOCOLenv (defaultHTTP/1.1for dev server)lib/AOT/runtime/superglobals_refresh.c— mirror other$_SERVERstring keystest/real/cases/web_server_protocol.phptServeTest/ServeAotTestassert protocol in$_SERVERfor one fixtureAcceptance criteria
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \ ./script/ci-local.sh --filter web_server_protocolFixture echoes
HTTP/1.1when served viaphpc serve.Verification (local / Docker only)
No
.github/workflows/*changes required.Dependencies
Links
lib/Web/DevServer.php,lib/Web/Superglobals.php