Skip to content

Run Linux PHP CLI on a native thread with Go signals blocked - #2647

Draft
henderkes wants to merge 2 commits into
mainfrom
fix/pcntl-gothread
Draft

Run Linux PHP CLI on a native thread with Go signals blocked#2647
henderkes wants to merge 2 commits into
mainfrom
fix/pcntl-gothread

Conversation

@henderkes

Copy link
Copy Markdown
Contributor

Build FrankenPHP as a Go archive hosted by C. Invoke Go's initializer with the original arguments for musl compatibility, retain Go extension setup, and execute PHP CLI on the original thread while Go threads block CLI signals. Preserve the Caddy server entry point in the same executable.

Wire the native launcher into Linux Docker, static and xcaddy builds. Cover external signals, Go callbacks, CLI arguments and exit codes, embedded scripts, and graceful server shutdown in regression tests.

Build FrankenPHP as a Go archive hosted by C. Invoke Go's initializer with
the original arguments for musl compatibility, retain Go extension setup,
and execute PHP CLI on the original thread while Go threads block CLI
signals. Preserve the Caddy server entry point in the same executable.

Wire the native launcher into Linux Docker, static and xcaddy builds.
Cover external signals, Go callbacks, CLI arguments and exit codes,
embedded scripts, and graceful server shutdown in regression tests.
@henderkes

henderkes commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

Oh god, this is even worse than I imagined.

Perhaps it's worth reaching upstream to go and PR a build tag that disables unmasking?

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.

1 participant