<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/php-interpreter-now-runs-natively-on-esp32-4-microcontrollers-0ohim9qwa" -->

---
title: PHP interpreter now runs natively on ESP32 4$...
description: php-baremetal has reached version 1.0, an unmodified Zend engine (the real PHP interpreter from php.net) cross-compiled to run directly on ESP32...
canonical: https://daily.dev/posts/php-interpreter-now-runs-natively-on-esp32-4-microcontrollers-0ohim9qwa
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: PHP interpreter now runs natively on ESP32 4$ microcontrollers | daily.dev
og:description: php-baremetal has reached version 1.0, an unmodified Zend engine (the real PHP interpreter from php.net) cross-compiled to run directly on ESP32...
og:url: https://daily.dev/posts/php-interpreter-now-runs-natively-on-esp32-4-microcontrollers-0ohim9qwa
og:image: https://api.daily.dev/og/posts/0OHIm9QWA.png
og:image:alt: PHP interpreter now runs natively on ESP32 4$ microcontrollers
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# PHP interpreter now runs natively on ESP32 4$ microcontrollers

**[Gianfrancesco Aurecchia](https://daily.dev/sources/euulsgixj5wsb2v39eacw)** · [@gianfrancescoaurecchia](https://daily.dev/gianfrancescoaurecchia) · 3 min read · 0 upvotes · 0 comments

## Summary

php-baremetal has reached version 1.0, an unmodified Zend engine (the real PHP interpreter from php.net) cross-compiled to run directly on ESP32 microcontrollers with no OS. It uses the official embed SAPI and native toolchains (RISC-V on ESP32-P4, Xtensa on S3) so PHP opcodes execute natively on the chip. On the ESP32-P4 with 32MB PSRAM it can serve stock Laravel and Symfony apps per-request like PHP-FPM, while the WiFi-equipped S3 board can host its own web server over a self-created access point. A demo shows an S3 board serving a PHP page over WiFi that controls an onboard RGB LED via GET parameters. The project is MIT-licensed, costs about $4 in hardware, and is positioned as stable/documented but not production-ready — missing multi-core support, real I2C drivers, and an event-driven model, all planned for version 2.0.

## Content

**TL;DR:** `php-baremetal` just hit **1.0** — the _unmodified_ Zend engine from php.net, cross-compiled for the ESP32 and running your `index.php` on the bare chip. No OS. No transpiler. No "PHP-like" subset. On the bigger board it even serves **stock Laravel and Symfony**.

## Why this is a little unhinged 🤯

- 🧠 **It's the real engine.** Same lexer, parser, opcode compiler, VM, GC — `<?php echo 1+1;` takes the exact same path as on your server. Same `index.php` → same output as desktop `php`.
- ⚙️ **Native, not emulated.** Built with the chip's own toolchain (RISC-V on the ESP32-P4, Xtensa on the S3), opcodes run on the CPU via the official `embed` SAPI.
- 🌐 **Frameworks work.** ESP32-P4 (32 MB PSRAM) serves real Laravel and Symfony per-request, like PHP-FPM. The S3 has WiFi on-die and can serve its own page over an AP it creates.
- 💸 **~$4.** A full PHP interpreter — standard lib, PDO SQLite, OPcache, even an OpenSSL build — on a chip that costs less than a coffee.

## An ESP32-S3 serving a PHP page over its own WiFi, in PHP

```
<?php
// init.php — runs once at boot, before the HTTP server starts.
wifi_ap_start('php-rgb', 'baremetal');            // SSID + WPA2 password
echo '[init] AP up at ' . wifi_ap_ip() . "\n";    // -> http://192.168.4.1/
s3_onboard_rgb_hsv(210, 255, 40);                 // onboard RGB LED -> a calm blue
```

```
<?php
// index.php — one run per HTTP request. GET /set?h=&s=&v=&on= drives the LED.
$h  = (int) ($_GET['h']  ?? 210);
$s  = (int) ($_GET['s']  ?? 255);
$v  = (int) ($_GET['v']  ?? 40);
$on = (int) ($_GET['on'] ?? 1);

$on ? s3_onboard_rgb_hsv($h, $s, $v) : s3_onboard_rgb_off();

header('Content-Type: application/json');
echo json_encode(['h' => $h, 's' => $s, 'v' => $v, 'on' => $on]);
```

Connect your phone to the board's WiFi, drag a slider, watch the physical LED change color. The microcontroller **is** the web server — no cloud, no broker, no app.

## The honest part 🛠️

`1.0` = stable and documented, **not** production-ready. It's a hobbyist/tinkerer thing today: still missing proper multi-core, an I²C bus with real drivers, and an event-driven model — which is exactly what **2.0 is about, already in progress**. MIT-licensed, roadmap is public, contributors welcome.

If you write PHP, you can already program a microcontroller. Turns out the line between "web dev" and "embedded dev" is about $4 wide.

---

- ⭐ Firmware: https://github.com/php-baremetal/php-esp32
- 🛠️ The `phpflash` CLI: https://github.com/php-baremetal/flash-tool
- 🧠 How it works: https://www.php-baremetal.com/blog/real-php-on-esp32
- 🔬 The WiFi + RGB example in detail: https://www.php-baremetal.com/blog/php-wifi-web-server-esp32-s3-control-led

## Similar posts on daily.dev

- [The newest ESP32 can actually run Linux, and it's getting uncomfortably close to a Raspberry Pi](https://daily.dev/posts/the-newest-esp32-can-actually-run-linux-and-it-s-getting-uncomfortably-close-to-a-raspberry-pi-ex3qklo9c) · XDA Developers · 0 upvotes · 0 comments
- [Espressif Systems releases a Linux BSP developer preview for ESP32-S31 RISC-V microprocessor](https://daily.dev/posts/espressif-systems-releases-a-linux-bsp-developer-preview-for-esp32-s31-risc-v-microprocessor-lmglqymci) · CNX Software · 1 upvotes · 0 comments
- [Show HN: Esp32sim – Run ESP32 firmware in the browser](https://daily.dev/posts/show-hn-esp32sim-run-esp32-firmware-in-the-browser-knunqisap) · Hacker News · 1 upvotes · 0 comments
- [Running Linux 6.11 On The ESP32-S3 With A Few Tweaks](https://daily.dev/posts/running-linux-6-11-on-the-esp32-s3-with-a-few-tweaks-havlry0ud) · Hackaday · 0 upvotes · 0 comments
- [Someone is running a website entirely off an ESP32 with 520 KB of RAM, and you can too](https://daily.dev/posts/someone-is-running-a-website-entirely-off-an-esp32-with-520-kb-of-ram-and-you-can-too-jkigjoyet) · XDA Developers · 0 upvotes · 0 comments

---

Tags: [#php](https://daily.dev/tags/php), [#iot](https://daily.dev/tags/iot), [#laravel](https://daily.dev/tags/laravel), [#embedded](https://daily.dev/tags/embedded)

[View this post on daily.dev](https://daily.dev/posts/php-interpreter-now-runs-natively-on-esp32-4-microcontrollers-0ohim9qwa)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/php-interpreter-now-runs-natively-on-esp32-4-microcontrollers-0ohim9qwa","headline":"PHP interpreter now runs natively on ESP32 4$ microcontrollers","text":"php-baremetal has reached version 1.0, an unmodified Zend engine (the real PHP interpreter from php.net) cross-compiled to run directly on ESP32 microcontrollers with no OS. It uses the official embed SAPI and native toolchains (RISC-V on ESP32-P4, Xtensa on S3) so PHP opcodes execute natively on the chip. On the ESP32-P4 with 32MB PSRAM it can serve stock Laravel and Symfony apps per-request like PHP-FPM, while the WiFi-equipped S3 board can host its own web server over a self-created access point. A demo shows an S3 board serving a PHP page over WiFi that controls an onboard RGB LED via GET parameters. The project is MIT-licensed, costs about $4 in hardware, and is positioned as stable/documented but not production-ready — missing multi-core support, real I2C drivers, and an event-driven model, all planned for version 2.0.","url":"https://daily.dev/posts/php-interpreter-now-runs-natively-on-esp32-4-microcontrollers-0ohim9qwa","datePublished":"2026-09-09T12:49:54.552Z","dateModified":"2026-09-09T12:55:44.256Z","author":{"@type":"Person","name":"Gianfrancesco Aurecchia","url":"https://daily.dev/gianfrancescoaurecchia","image":"https://lh3.googleusercontent.com/a/ACg8ocKQhT3-1Y4HYykJumzbqSSKCnTMYsIL0bPNtJciNeEb09RUZLY-=s96-c","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":60}},"image":"https://media.daily.dev/image/upload/s--7CCj9cdQ--/f_auto/v1788958250/posts/0OHIm9QWA?_a=BAMAMicg0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/sources/euulsgixj5wsb2v39eacw","name":"Gianfrancesco Aurecchia"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Gianfrancesco Aurecchia","item":"https://daily.dev/sources/euulsgixj5wsb2v39eacw"},{"@type":"ListItem","position":3,"name":"PHP interpreter now runs natively on ESP32 4$ microcontrollers"}]}
```

