debug-php-wasm-side-modules
Skill by WordPress
Debugs dynamic PHP extensions built as WASM side modules for PHP.wasm. It covers dlopen failures, JSPI and Asyncify crashes, C++ weak symbol issues, and extension loading. Written for developers working with extensions such as Xdebug, intl, or GD.
Install debug-php-wasm-side-modules
Built from the published package, never by AI.
git clone --depth 1 https://github.com/WordPress/wordpress-playground /tmp/wordpress-playground && mkdir -p ~/.claude/skills && cp -r /tmp/wordpress-playground/.agents/skills/debug-php-wasm-side-modules ~/.claude/skills/debug-php-wasm-side-modulesRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install debug-php-wasm-side-modules in Claude Code
git clone --depth 1 https://github.com/WordPress/wordpress-playground /tmp/wordpress-playground && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/wordpress-playground/.agents/skills/debug-php-wasm-side-modules ~/.gemini/antigravity-cli/skills/debug-php-wasm-side-modulesAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install debug-php-wasm-side-modules in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill gives patterns for diagnosing and fixing problems with dynamic PHP extensions that are built as WASM side modules and loaded with dlopen. It lists specific symptoms, such as zend_mm_panic after a zend_extension line in php.ini, SuspendError from side modules, and table index errors during Asyncify rewind, and gives a fix for each. Topics include making _dlopen_js synchronous, redirecting blocking C calls like recv to JS imports, and the ASYNCIFY_IMPORTS flag.
The skill also covers the file writing lifecycle for extensions, loading .so files on the web, and the need to match Emscripten versions between the main and side modules. It names Xdebug, intl and GD as example extensions. It is aimed at developers building or debugging PHP.wasm runtimes and their extensions.
Written from the project's SKILL.md and checked against it.
What it can do
- dlopen and _dlopen_js fixesExplains why _dlopen_js must be synchronous under JSPI and how to set it.
- JSPI suspension in side modulesShows how to redirect blocking C calls such as recv to JS wrappers.
- Asyncify configurationCovers ASYNCIFY_IMPORTS for renamed imports and how to verify instrumentation.
- Extension loading lifecycleExplains when to write .so and ini files relative to PHP startup.
- C++ weak symbol fixesDescribes two-pass instantiation and patching source to avoid JS stubs.
- Web extension loadingShows how to fetch .so bytes and write them to the virtual filesystem.
- Diagnostic cheat sheetMaps errors such as zend_mm_panic or bad export type to suggested actions.
- Debugging commandsLists wasm-objdump and Node.js snippets to inspect side module imports and exports.
What you need
- Node.js with @php-wasm/node
- Emscripten toolchain
- Docker for building extensions
- wasm-opt and wasm-objdump command line tools
Try asking
- My PHP.wasm build crashes with zend_mm_panic after loading zend_extension.
- Why does my Xdebug side module fail with SuspendError under JSPI?
- Check whether my side module imports the Asyncify shared globals.
Good to know
- Each PHP version needs its own side module build.
- Main and side modules must be compiled with the same Emscripten version.
- Web builds need MAIN_MODULE and ENVIRONMENT=web,worker.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/debug-php-wasm-side-modules/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to debug-php-wasm-side-modules
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
debug-php-wasm-side-modules: common questions
What causes zend_mm_panic when loading an extension in PHP.wasm?
The skill says _dlopen_js is marked async by default, and under JSPI its wrapper can corrupt the WASM stack. Setting _dlopen_js__async to false is the fix it gives.
Why does extension_loaded() return true but the extension still fails?
The source says extension_loaded() only shows that MINIT succeeded. It recommends testing real features, such as hitting a breakpoint for Xdebug or running a collation for intl.
Why are extension files missing at runtime in PHP.wasm?
Files written in a user callback passed to loadNodeRuntime are silently lost, because it overwrites onRuntimeInitialized. The source advises using php.writeFile() after new PHP(runtime).
How do I install debug-php-wasm-side-modules?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is debug-php-wasm-side-modules free?
The code is published under the GPL-2.0 licence. The service it connects to may have its own pricing.
Is debug-php-wasm-side-modules safe to use?
It scores 78 of 100. Grades: maintenance A, licence C, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to debug-php-wasm-side-modules?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
