WebAssembly PHP for Node.js
This package ships WebAssembly PHP binaries and the JavaScript API optimized for Node.js. It comes with the following PHP extensions:
- SQLite
- Libzip
- Libpng
- CLI
- OpenSSL
- MySQL
It uses the host filesystem directly and can access the network if you plug in a custom
WS proxy.
Here's how to use it:
import { PHP } from '@php-wasm/universal';
import { loadNodeRuntime } from '@php-wasm/node';
const php = new PHP(await loadNodeRuntime('8.3'));
const output = await php.runStream({
code: '<?php phpinfo(); ?>',
});
console.log(await output.stdoutText);
Attribution
@php-wasm/node started as a fork of the original PHP to WebAssembly build published by Oraoto in https://github.com/oraoto/pib and modified by Sean Morris in https://github.com/seanmorris/php-wasm.
[v3.0.15] (2025-10-27)
Tools
Import/Export
- [Blueprints] Use _SERVER['HTTPS'] in the import step. (#2802)
Website
- Add Playground logo and 'import' menu to the sidebar. (#2806)
- Ask for a Playground name before saving. (#2768)
- File browser and code editor. (#2813)
- Move the sidebar icon to the right. (#2811)
- Refresh button icons next to the browser bar. (#2807)
- Resizable sidebar. (#2809)
- Restore the visible button selection in the sidebar. (#2804)
- Retain address bar when opening the sidebar. (#2808)
Various
- [i18n] Add Japanese translations to
remote.html vs index.html. (#2817)
Contributors
The following contributors merged PRs in this release:
@adamziel @shimotmk