PHP in Browser (powered by WebAssembly)
Install with npm:
$ npm install php-wasmYou'll need to add the following postinstall script entry to your package.json to ensure the static assets are available to your web application. Make sure to replace public/ with the path to your public document root if necessary.
{
"scripts": {
"postinstall": [
"cp node_modules/php-wasm/php-web.* public/"
]
},
}If you're using a more advanced bundler, use the vendor's documentation to learn how to move the files matching the following pattern to your public directory:
./node_modules/php-wasm/php-web.*Using php-wasm is easy.
Once the library is included in the page, you can run PHP right from a script tag! The src attribute is also supported for non-inline
No open issues yet, or sync has not completed.