Problem
README documents dev workflows (phpc serve, phpc serve --aot) but not a single production narrative from phpc build → live site behind nginx.
Pieces exist across closed issues:
Contributors still grep #50 , #180 , #443 for the full story.
Goal
Umbrella production deployment guide (extend docs/deploy-web-aot.md or add docs/deploy-production.md) covering:
Build + deploy — phpc build --project, phpc deploy, dist layout (#609 , #635 )
Static assets — nginx alias for assets/ / public/ (#696 )
CGI — per-request env (QUERY_STRING, REQUEST_METHOD, PATH_INFO, …) — Web: Runtime-populated superglobals for JIT and AOT (per-request $_GET/$_POST) #49 , Web: AOT CGI wrapper for phpc-built binaries (production nginx spawn) #665
FastCGI — nginx fastcgi_pass pool — Web: FastCGI request loop adapter (nginx / php-fpm compatible) #173 (when implemented)
TLS termination — reverse proxy in front of CGI (illustrative only)
Security — body limits Security: Request body size limits and header sanitization in CGI driver #77 , PHP_COMPILER_DEBUG, path traversal, contact validation Security: MiniWebApp contact POST validation and body limits (dev + deploy) #697
Local smoke before deploy — make examples-web-smoke, phpc cgi on dist, optional --aot (Testing: ServeAotTest MiniWebApp routes via phpc serve --aot (blocked #764 execute) #478 , Testing: CgiDriverTest MiniWebApp PATH_INFO via AOT cgi-wrapper (blocked #764) #682 )
Implementation hints
Section
Source issues
Files
Quickstart (done)
#635
docs/deploy-web-aot.md
nginx CGI
#665 , #50
bin/cgi-aot.php, docs/deploy-web-aot.md
Static files
#696
examples/003-MiniWebApp/assets/
FastCGI
#173
new lib/Web/FastCgi*.php TBD
MiniWebApp AOT
#568 , #445
blocked until native link
Checklist
#472 , #657
phpc doctor --gates
Suggested doc outline
Prerequisites (LLVM, Docker image php-compiler:22.04-dev)
Build/deploy commands (002 green, 003 blocked note)
Dist tree diagram (bin/app, cgi-wrapper, assets/, templates/)
nginx server block (CGI + static locations)
FastCGI appendix (stub until Web: FastCGI request loop adapter (nginx / php-fpm compatible) #173 )
Operations (env vars, logs, upgrading binary)
Verification commands (local only)
Acceptance criteria
Verification (review)
./phpc deploy examples/002-StaticWeb -o /tmp/static-dist
phpc cgi /tmp/static-dist/bin/app
make examples-web-smoke
Optional: script/check-doc-links.sh if link checker exists.
Dependencies
Non-goals
Links
Problem
README documents dev workflows (
phpc serve,phpc serve --aot) but not a single production narrative fromphpc build→ live site behind nginx.Pieces exist across closed issues:
docs/deploy-web-aot.mdquickstart (phpc deploy,PHPC_DEPLOY_ROOT, nginx CGI snippet)Contributors still grep #50, #180, #443 for the full story.
Goal
Umbrella production deployment guide (extend
docs/deploy-web-aot.mdor adddocs/deploy-production.md) covering:phpc build --project,phpc deploy, dist layout (#609, #635)aliasforassets//public/(#696)QUERY_STRING,REQUEST_METHOD,PATH_INFO, …) — Web: Runtime-populated superglobals for JIT and AOT (per-request $_GET/$_POST) #49, Web: AOT CGI wrapper for phpc-built binaries (production nginx spawn) #665fastcgi_passpool — Web: FastCGI request loop adapter (nginx / php-fpm compatible) #173 (when implemented)PHP_COMPILER_DEBUG, path traversal, contact validation Security: MiniWebApp contact POST validation and body limits (dev + deploy) #697make examples-web-smoke,phpc cgion dist, optional--aot(Testing: ServeAotTest MiniWebApp routes via phpc serve --aot (blocked #764 execute) #478, Testing: CgiDriverTest MiniWebApp PATH_INFO via AOT cgi-wrapper (blocked #764) #682)Implementation hints
docs/deploy-web-aot.mdbin/cgi-aot.php,docs/deploy-web-aot.mdexamples/003-MiniWebApp/assets/lib/Web/FastCgi*.phpTBDphpc doctor --gatesSuggested doc outline
php-compiler:22.04-dev)bin/app,cgi-wrapper,assets/,templates/)locations)Acceptance criteria
Verification (review)
Optional:
script/check-doc-links.shif link checker exists.Dependencies
Non-goals
Links
docs/deploy-web-aot.mdexamples/README.md