Skip to content

Docs: Production deployment guide (nginx + AOT binary + CGI/FastCGI) #445

@PurHur

Description

@PurHur

Problem

README documents dev workflows (phpc serve, phpc serve --aot) but not how to run a compiled web app behind nginx or systemd in production.

Contributors must stitch together #50 (CGI driver), #173 (FastCGI), and #180 (deploy bundle) without a single doc path from phpc build → live site.

Goal

Add docs/deploy-web-aot.md (linked from README) covering:

  1. Build: phpc build --project . or manifest entry + binary
  2. Layout: dist/bin/app, public/ assets, phpc.json (#180)
  3. CGI: spawn binary per request; env vars (QUERY_STRING, REQUEST_METHOD, …) — Web: Runtime-populated superglobals for JIT and AOT (per-request $_GET/$_POST) #49 runtime superglobals
  4. FastCGI: nginx fastcgi_pass snippet — Web: FastCGI request loop adapter (nginx / php-fpm compatible) #173
  5. Static files: nginx try_files vs DevServer static handler
  6. Security pointers: Security: Request body size limits and header sanitization in CGI driver #77 body limits, PHP_COMPILER_DEBUG, no directory traversal
  7. Local smoke before deploy: make examples-web-smoke, optional --aot (Testing: Optional examples-web-smoke --aot gate in ci-local when LLVM present #444)

Acceptance criteria

  • New doc file committed; README “Developing web apps” links to it
  • Copy-paste nginx location block marked illustrative (not CI-tested)
  • All verification steps use local/Docker commands only

Verification (review)

No PHPUnit required; optional link check in script/check-doc-links.sh if added later.

Dependencies

Non-goals

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:toolingTooling / CI / docsarea:webWeb / CGI / superglobalsenhancementNew feature or requestphase-3:aotPhase 3 – AOT deployment

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions