Category
runtime / tooling (web deploy)
Problem
#173 tracks the FastCGI protocol adapter (record loop, param mapping, nginx/php-fpm compatibility). #2397 tracks 009-FastCGIWeb deploy smoke after the adapter lands.
There is no focused issue for the user-facing CLI that operators run in production:
phpc fcgi --project examples/009-FastCGIWeb
# or: php bin/fcgi.php …
Without a CLI issue, adapter work in #173 risks landing as an internal library with no documented flags, env, or phpc doctor row.
php-src reference
sapi/fpm/fpm/fpm_main.c — php-fpm worker loop (behavioral reference, not code port)
main/fastcgi.c — FastCGI record I/O in php-src
sapi/cgi/cgi_main.c — CGI param mapping (reuse patterns from this repo’s bin/cgi.php)
Repro (today)
./script/docker-exec.sh -- bash -lc ' source script/php-env.sh && ./phpc fcgi --help'
This compiler: subcommand missing or stub — operators cannot start a FastCGI worker via phpc.
Goal
phpc fcgi subcommand in bin/phpc.php → lib/Cli/PhpcFcgi.php (name TBD)
bin/fcgi.php thin entry for packaged deploy trees (mirror bin/serve.php / bin/cgi.php)
Flags: --project / manifest path, listen socket or stdin/stdout FastCGI mode (document v1 scope)
phpc doctor --gates + docs/local-ci-matrix.md row after CI: FASTCGI_SMOKE_GATE opt-in in ci-local after #173 lands #1899 smoke exists
examples/009-FastCGIWeb/README.md documents production invocation
Scope (v1)
In scope
Out of scope
Wrap #173 adapter; map FastCGI params → CGI superglobals
Full Zend php-fpm feature parity
Run AOT binary from phpc.json build.output
In-process JIT per request (#207 )
Health route parity with 009 (ok + PATH_INFO diagnostics)
Windows IIS FastCGI
Implementation hints
Piece
Path
Notes
Adapter
lib/Web/FastCgi*.php (#173 )
Reuse CGI overlay from deploy-smoke (#665 , #718 )
CLI
lib/Cli/PhpcFcgi.php, bin/fcgi.php
Mirror PhpcServe / PhpcCgi patterns
Deploy
phpc deploy tree
Optional public/fcgi.php shim — coordinate #635 ✅
Test
test/unit/FastCgiIntegrationTest.php
@group serve; blocked until #173
CI
#1899
FASTCGI_SMOKE_GATE — not #2369 (009 VM/AOT example smokes)
Done when
./script/docker-exec.sh -- bash -lc ' source script/php-env.sh && ./phpc fcgi --help'
# after #173:
./script/docker-exec.sh -- bash -lc ' FASTCGI_SMOKE_GATE=1 ./script/ci-local.sh'
Dependencies
De-duplication
Issue
Relationship
#173
Protocol implementation — this issue is CLI/DevEx wrapper only
#2369
Promotes 009 VM/AOT example smokes — not FastCGI protocol
#1899
CI gate for adapter integration — lands after #173 + CLI
Links
Category
runtime/ tooling (web deploy)Problem
#173 tracks the FastCGI protocol adapter (record loop, param mapping, nginx/php-fpm compatibility). #2397 tracks 009-FastCGIWeb deploy smoke after the adapter lands.
There is no focused issue for the user-facing CLI that operators run in production:
phpc fcgi --project examples/009-FastCGIWeb # or: php bin/fcgi.php …Without a CLI issue, adapter work in #173 risks landing as an internal library with no documented flags, env, or
phpc doctorrow.php-src reference
sapi/fpm/fpm/fpm_main.c— php-fpm worker loop (behavioral reference, not code port)main/fastcgi.c— FastCGI record I/O in php-srcsapi/cgi/cgi_main.c— CGI param mapping (reuse patterns from this repo’sbin/cgi.php)Repro (today)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && ./phpc fcgi --help'This compiler: subcommand missing or stub — operators cannot start a FastCGI worker via
phpc.Goal
phpc fcgisubcommand inbin/phpc.php→lib/Cli/PhpcFcgi.php(name TBD)bin/fcgi.phpthin entry for packaged deploy trees (mirrorbin/serve.php/bin/cgi.php)--project/ manifest path, listen socket or stdin/stdout FastCGI mode (document v1 scope)phpc doctor --gates+docs/local-ci-matrix.mdrow after CI: FASTCGI_SMOKE_GATE opt-in in ci-local after #173 lands #1899 smoke existsexamples/009-FastCGIWeb/README.mddocuments production invocationScope (v1)
php-fpmfeature parityphpc.jsonbuild.outputok+ PATH_INFO diagnostics)Implementation hints
lib/Web/FastCgi*.php(#173)lib/Cli/PhpcFcgi.php,bin/fcgi.phpPhpcServe/PhpcCgipatternsphpc deploytreepublic/fcgi.phpshim — coordinate #635 ✅test/unit/FastCgiIntegrationTest.php@group serve; blocked until #173FASTCGI_SMOKE_GATE— not #2369 (009 VM/AOT example smokes)Done when
phpc fcgi --helpdocuments flags and links Web: FastCGI request loop adapter (nginx / php-fpm compatible) #173 / Docs: Production deployment guide (nginx + AOT binary + CGI/FastCGI) #445phpc fcgi --project examples/009-FastCGIWebserves healthokvia FastCGI client test (local loopback)Dependencies
De-duplication
Links