About this project

The PHP you know.
The hardware
you don't (yet).

PHP Baremetal exists so web developers can program hardware with the language they already use every day — without learning C first.

It cross-compiles the official Zend engine for the chip, so a script behaves on the board the way it does on your laptop. Not a subset. Not a reimplementation. The same interpreter.

PHP versions
8.3–8.5
Chip families
2
Boards
12
Lines re-implemented
0
01 — Revision history

From "could this
even work?" to a platform.

  1. Rev A · Experiment

    Could this even work?

    Building the PHP interpreter for a RISC-V microcontroller, just to see if it would boot.

  2. Rev B · Full port

    Two chip families

    Three PHP versions, OpenSSL, OPcache — and stock Laravel and Symfony serving pages over HTTP from an ESP32.

  3. Rev C · Platform

    phpbm + SDKs

    One host tool, pluggable SDKs and a registry of extensions and HALs. In preview today; the 1.x firmware stays at v1.5.0.

  4. Rev D · Next

    ESP32-S31 · i.MX RT · STM32H7 · RP2350

    New SDKs for new architectures and vendors. Same project, same commands.

02 — Design rules

Three rules
we don't bend.

Rule 01

Upstream or nothing

The official Zend engine from php.net, cross-compiled. Zero lines re-implemented, so PHP behaves on the board as it does everywhere else.

Rule 02

Web developers first

If you can write a Composer package, you can program a microcontroller. C is optional, not the entry fee.

Rule 03

Built in the open

MIT licensed, developed on GitHub, distributed through a public registry. Anyone can add an extension, a HAL or a whole SDK.

03 — Maintainers

Who's on the bench.

Creator & maintainer

Gianfrancesco Aurecchia

@GianfriAur

PHP developer with a focus on embedded systems and IoT. Built PHP Baremetal to bring the real PHP interpreter to microcontrollers — cross-compiling the unmodified Zend engine for the chip so the language of the web runs on the metal.

U2 · OPEN FOOTPRINT

Your name here.

Open an issue or send a pull request and you're on the contributors list.

Contribute →
04 — Open sockets

Pick a socket.
Plug in.

Next on the bench: ESP32-S31, i.MX RT, STM32H7 and RP2350. Every new chip needs its board files, and every new SDK needs its HALs in the registry.

Socket · C / embedded

Embedded & C developers

Write HALs for missing platforms, drivers, and the next SDKs. Bring up a new board or shrink the footprint.

Socket · PHP

PHP developers

Build projects, libraries and examples. Run frameworks and Composer packages on real hardware, break things and file issues.

Socket · Docs

Technical writers

Turn hard-won knowledge into guides people can follow on a first try. The docs publish from the package repos.