Compiles PHP to WebAssembly (Docker + Emscripten) — Node.js/JSPI only.
Builds the @kirigami/php-wasm runtime for the Kirigami static site generator.
php-wasm-compiler builds our own PHP → WebAssembly toolchain, forked from the WordPress Playground @php-wasm/compile pipeline (via php-kirigami/php-wasm-builder) and trimmed to exactly what Kirigami needs:
- ✅ JSPI (JavaScript Promise Integration) target only
- ✅ Node.js runtime only
- ❌ No browser build, no Asyncify
A single config.yaml drives the whole build — PHP versions, which extensions to compile in (statically today, as loadable Kirigami plugins later), and build options — with an interactive CLI or a --quiet flag for CI. See CLAUDE.md for the full architecture and decision history, and NOTICE.md for the upstream code's provenance.
- Docker
- Node.js
>= 24.0.0 - GNU Make — ships by default on Linux/macOS, but not on Windows (install separately, e.g. via Chocolatey/Scoop/MSYS2, or run from inside WSL)
- A POSIX shell + coreutils (
sh,mkdir -p,rm -rf,mv) — also not default on Windows (Git for Windows/Git Bash or MSYS2 provide these;cmd.exedoes not) - On Windows: WSL with an Ubuntu distro that has Node
>= 24.0.0installed
All of the above (except the WSL/Ubuntu/Node-in-WSL check, Windows-only) are checked automatically when you run node compile/cli.mjs.
All build options live in config.yaml (PHP versions, extensions, build options) — see also matrix.json for the known versions of each third-party library.
Once, or after an update:
cd compile
npm install
make base-image
make all_jspicd compile
# Interactive: review/edit config.yaml before running the build
node cli.mjs
# Silent (CI): use config.yaml as-is, no prompts
node cli.mjs --quiet
# Print the commands that would run, without building
node cli.mjs --quiet --dry-runGPL-2.0-or-later — inherited from the upstream WordPress Playground project. See LICENSE for the full text, and NOTICE.md for provenance details.
Maxime Larrivée-Roy, 2026