- Install
ea-apache24-mod-wasm. - Then you need to download the version of the PHP
.wasmruntime file that you need from WASM runtime releases. - Place the downloaded
.wasmfile in an appropriate subdirectory of/usr/local/apache2/wasm_modules- e.g.
/usr/local/apache2/wasm_modules/php-wasm/php-cgi-8.2.6.wasm
- e.g.
- Update your
.htaccessas follows:
<IfModule wasm_module>
AddHandler wasm-handler .php
WasmModule /usr/local/apache2/wasm_modules/php-wasm/php-cgi-8.2.6.wasm
WasmDir /tmp
WasmEnv TMPDIR /tmp
WasmMapDir / /
WasmEnableCGI On
</IfModule>
Here is a way to test it:
<html>
<body>
<?php
print "<h1>Hello from WASM PHP!</h1>";
$date = getdate();
$message = "Today, ";
$message .= $date['weekday'] . ", ";
$message .= $date['year'] . "-";
$message .= $date['mon'] . "-";
$message .= $date['mday'];
$message .= ", at ";
$message .= $date['hours'] . ":";
$message .= $date['minutes'] . ":";
$message .= $date['seconds'];
$message .= " we greet you with this message!";
print $message;
print "<h1>Output from phpinfo():</h1>";
phpinfo();
?>
</body>
</html>
That is the plan. The WASM folks are in the process of moving things around so once that settles we will revisit providing them.
What we provide also depends on what people need. So this patient approach will give us a chance to collect that sort of data to help ensure we implement what people need.