@php-wasm/web v0.7.19
WebAssembly PHP for the web
This package ships WebAssembly PHP binaries and the JavaScript API optimized for the web and a low bundle size. It comes with the Libzip extension and the SQLite extension.
Here's how to use it:
import { PHP } from '@php-wasm/web';
// PHP.load() calls import('php.wasm') internally
// Your bundler must resolve import('php.wasm') as a static file URL.
// If you use Webpack, you can use the file-loader to do so.
const php = await PHP.load('8.0', {
requestHandler: {
documentRoot: '/www',
},
});
// Create and run a script directly
php.mkdirTree('/www');
php.writeFile('/www/index.php', `<?php echo "Hello " . $_POST['name']; ?>`);
await php.run({ scriptPath: './index.php' });
// Or use the familiar HTTP concepts:
const response = await php.request({
method: 'POST',
url: '/index.php',
data: { name: 'John' },
});
console.log(response.text);
Attribution
@php-wasm/web
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.
10 days ago
10 days ago
10 days ago
10 days ago
10 days ago
10 days ago
9 days ago
9 days ago
9 days ago
10 days ago
9 days ago
9 days ago
10 days ago
16 days ago
16 days ago
23 days ago
24 days ago
29 days ago
30 days ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
7 months ago
7 months ago
11 months ago
12 months ago
11 months ago
11 months ago
11 months ago
12 months ago
12 months ago
12 months ago
12 months ago
11 months ago
11 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago