Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119201 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 92757 invoked from network); 23 Dec 2022 04:43:30 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Dec 2022 04:43:30 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 10BA61804A7 for ; Thu, 22 Dec 2022 20:43:28 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-vk1-f178.google.com (mail-vk1-f178.google.com [209.85.221.178]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 22 Dec 2022 20:43:27 -0800 (PST) Received: by mail-vk1-f178.google.com with SMTP id v81so1826742vkv.5 for ; Thu, 22 Dec 2022 20:43:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=OpYjRP/U/4pv7UPYE2PBntPFrC3aWlmkujYE31n1Uvc=; b=DBerWjWms0KdtwNFG0KlqXAk/3RGSzMOVpNorhHeVsKCNFCWNO5sMAwzCCGSMi7qUx kjqxB4e9wSwACMjHQwWihnoWJzil1ljAYOemNj0ws3WLRKU2OEWU2riFdM3ZoDr+E1Nr MMkbgK5jTbFHKPkbWZbM+BSWS5ojKPJpTH4X1USMsQKFXtXNpCG+Uae0/jLGoH54EPlA LRewC93XDCHugpsE9oa9c3gyO+R4of4Kpmw1cG7a36S14j3iwkZ0D1BRHW6grT4zMyG9 9lFbaTmIjaXLiYWVp1qrklezSthIIV0xDfN9SpLeF7o+6r1Vj92u3iDLN+yZFtdgXIgK Ah/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OpYjRP/U/4pv7UPYE2PBntPFrC3aWlmkujYE31n1Uvc=; b=T6rJLyYgLBXz3PpmMe0ueWM/AIeIon2DPw89tsw7Wztxb/fg0wGGOE0264R6w0DHWR HW7wVPghWHSkLmnJNcakfQFTk9zaQdvQNdhxq1kcHey93gOJZnRDwQUI5q/tCVgOMqXz 5Sxog+eUAWupnSwVUVwDlZSe9pP7YU7laoemgkQNY/Wety2E5rukWjXF83CeZ+7cWFyR JPLTq3G+KT56vm7+DlV1a7cT4LbMuZgCqRLB2WsujeLyprYIM5RKCg+4DylGc6mcyMNK chHXhMZ5ey2XnjTa91RkM1evTqV9cvHtnL6eoXwYDnfr03yqX8JxqphoXEH5EKgVUxAF wOaw== X-Gm-Message-State: AFqh2kq55/2yE7NPa7HDecFAXIKjqDuoGhIM3dY7ze4c6cbcH/fqZBcP ud9BTZHSiY7zKUzteEJ/+b22ewDT73vn1HjJ6LY= X-Google-Smtp-Source: AMrXdXtONoiFPL4zQvZmKfAE4Vt6MwupkpoQpzF/w4AKFXPFZgrjCib9qvuCd77MYMRwl+KezmSEj/F08ZWDyoAQjnk= X-Received: by 2002:a1f:a2d3:0:b0:3c6:a5d6:1b5 with SMTP id l202-20020a1fa2d3000000b003c6a5d601b5mr862122vke.12.1671770606568; Thu, 22 Dec 2022 20:43:26 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ab0:6257:0:b0:420:2bfe:3fa8 with HTTP; Thu, 22 Dec 2022 20:43:26 -0800 (PST) In-Reply-To: References: Date: Fri, 23 Dec 2022 09:43:26 +0500 Message-ID: To: =?UTF-8?B?UmFmYWVsIEZlcm7DoW5kZXogTMOzcGV6?= Cc: "internals@lists.php.net" , Asen Alexandrov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] PHP build for the wasm32-wasi target From: office.hamzaahmad@gmail.com (Hamza Ahmad) HI Rafael, I am happy to here that you guys are working on this. I once thought of writing such a solution myself for PHP when I learnt it compiled c. However, I could not manage time. I am positive it will be useful. NVM< I don't know why Google has marked your email as spam. Likely, that's why, you have not been responded as yet. Best On 12/22/22, Rafael Fern=C3=A1ndez L=C3=B3pez wrot= e: > Hello community, > > I am reaching out on behalf of the WasmLabs team at the Office of the CTO= at > VMware. > > We have been working on building PHP for WebAssembly, specifically for th= e > wasm32-wasi target. WASI [1] is a system interface that allows WebAssembl= y > to run on the server side by safely being able to access operating > system-like features, including files and filesystems, Berkeley sockets, > clocks and random numbers [2]. > > WebAssembly in the server side is experiencing a big growth both in inter= est > and users. There are other programming language interpreters that can be > compiled to wasm32-wasi as of today; for example: Python [3] and Ruby [4]= . > > We have patches for PHP 7.3.33 and 7.4.32 at the time of writing. Porting > PHP 8.2.0 is work in progress at this time. > > In the interest of getting feedback from the PHP community I am providing > links to the patches at GitHub. Please, let us know what would be the nex= t > step to contribute and continue to maintain this work upstream. We look > forward to work with the PHP community. > > If you want to try it out, you can download the binaries we are producing= in > the CI/CD pipeline for 7.3.33 [5] and 7.4.32 [6]. You can use a WASI-enab= led > WebAssembly runtime such as Wasmtime [7] to run PHP compiled to > wasm32-wasi. > > Patches: 7.3.33 [8], 7.4.32 [9][10]. > > Example execution: > > ``` > $ wasmtime -- --dir ~/php-example php-cgi-7.4.32.wasm > ~/php-example/hello/index.php > X-Powered-By: PHP/7.4.32 > Content-type: text/html; charset=3DUTF-8 > > Hello, world! > ``` > > We have already presented some of this work at OSS conferences and events > like Kubecon and Docker Community days, and have written a few articles > providing the background to the port, its limitations and what can curren= tly > be accomplished (including running WordPress!). Please find below some li= nks > to the talks and articles: > > - Porting PHP to WebAssembly using WASI [11] > - Running WordPress with WebAssembly using mod_wasm and Apache [12] > - WebAssembly: Docker without containers! [13] > - mod_wasm: Bringing WebAssembly to Apache [14]: this talk builds on top = of > PHP 7.3.33 and shows WordPress running with sqlite on top of Apache, than= ks > to an Apache module (mod_wasm) that is able to execute WebAssembly module= s. > - Docker and WebAssembly, better together [15]: this presentation feature= s > PHP 7.4.32 and explains a bit of the context of this work. > > > Thank you, > Rafael Fern=C3=A1ndez L=C3=B3pez. > > [1] https://wasi.dev/ > [2] > https://github.com/bytecodealliance/wasmtime/blob/03463458e426d4bd0601ebd= 82e95b668fc982443/docs/WASI-intro.md > [3] https://docs.python.org/3/whatsnew/3.11.html > [4] https://www.ruby-lang.org/en/news/2022/12/06/ruby-3-2-0-rc1-released/ > [5] > https://github.com/vmware-labs/webassembly-language-runtimes/releases/tag= /php%2F7.3.33%2B20221124-2159d1c > [6] > https://github.com/vmware-labs/webassembly-language-runtimes/releases/tag= /php%2F7.4.32%2B20221124-2159d1c > [7] https://wasmtime.dev/ > [8] > https://github.com/vmware-labs/webassembly-language-runtimes/tree/main/ph= p/php-7.3.33/patches > [9] > https://github.com/vmware-labs/webassembly-language-runtimes/blob/main/ph= p/php-7.4.32/patches/0001-Initial-port-of-7.3.33-patch-to-7.4.32.patch > [10] > https://github.com/vmware-labs/webassembly-language-runtimes/blob/main/ph= p/php-7.4.32/patches/0002-Fix-mmap-issues.-Add-readme.patch > [11] https://wasmlabs.dev/articles/php-wasm32-wasi-port/ > [12] https://wasmlabs.dev/articles/running-wordpress-with-mod-wasm/ > [13] https://wasmlabs.dev/articles/docker-without-containers/ > [14] https://www.youtube.com/watch?v=3DjXe8kulUscQ > [15] https://youtu.be/yo30oF1Gflo?t=3D7361 >