Skip to content

Web: AOT CGI wrapper for phpc-built binaries (#665)#680

Merged
PurHur merged 1 commit into
masterfrom
issue-665-aot-cgi-wrapper
May 22, 2026
Merged

Web: AOT CGI wrapper for phpc-built binaries (#665)#680
PurHur merged 1 commit into
masterfrom
issue-665-aot-cgi-wrapper

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 22, 2026

Summary

  • Add bin/cgi-aot.php / bin/cgi-aot.sh and phpc cgi to run native AOT binaries under CGI env (stdin → REQUEST_BODY / REQUEST_BODY_FILE, PHPC_DEPLOY_ROOT resolution).
  • Normalize AOT stdout into CGI/1.1 form (Status: line + blank line before body) for nginx/apache spawn.
  • phpc deploy now copies cgi-wrapper into dist/ with updated README.deploy instructions.

Test plan

  • vendor/bin/phpunit --filter 'CgiDriverTest|CgiAotDriverTest|PhpcDeployTest' (Docker)
  • vendor/bin/phpunit --group aot-link --filter CgiDriverTest (LLVM AOT smoke)
  • Manual: phpc build -o /tmp/app examples/001-SimpleWeb/example.php then REQUEST_METHOD=GET QUERY_STRING=name=AotCgi php bin/cgi-aot.php /tmp/app

Closes #665

Made with Cursor

Add bin/cgi-aot.php/sh and phpc cgi to ingest stdin POST bodies, exec native
binaries under CGI env, and emit a proper Status + headers + body response.
phpc deploy now ships cgi-wrapper for nginx ScriptAlias production spawn.

Closes #665

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit e056e49 into master May 22, 2026
@PurHur PurHur deleted the issue-665-aot-cgi-wrapper branch May 22, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web: AOT CGI wrapper for phpc-built binaries (production nginx spawn)

1 participant