
Meet Lela: a brand-new PHP engine, written in Rust
Every so often something shows up in the PHP world that makes you sit up and say, "Wait, someone built that?" Lela is one of those.
Lela is an independent, open-source PHP engine written in Rust. It's meant to be a drop-in replacement for the engine you already run. The idea is simple and a little bold: keep your application, your framework, and your Composer packages exactly as they are, and swap what executes them.
It's in open alpha, so this is a "kick the tires and cheer it on" project, not a "move production over on Monday" one. Still, there's a lot to like. Let's walk through it.
What Lela is
Think of PHP as two things: the language you write and the engine that runs it. The engine that has powered PHP for decades is written in C. Lela is a fresh implementation of that engine in Rust, tracking PHP 8.5 (the site says it follows PHP 8.5.12).
The pitch is compatibility first. Lela replaces the engine only, so your code, frameworks, and packages should run unchanged. To keep itself honest, the project measures itself against PHP's own test suite. When I looked on November 23, the site reported that Lela passed 92.03% of it. For a project this young, that's an impressive number.
A few other details worth knowing:
- It's MIT licensed. Some parts are derived from php-src and carry the PHP License, with the notices spelled out in the project's NOTICE file.
- It's built by Mitchell van Wijngaarden.
- It isn't affiliated with or endorsed by The PHP Group, the PHP Foundation, or Perforce Software. It's an independent effort.
- It currently targets macOS on arm64 and Ubuntu 26.04 on arm64 and x86-64.
Why it was created
The project doesn't publish a long origin story, so I won't invent one. What the site does make clear is what Lela is betting on: memory safety.
PHP's C engine leaves memory management to the people writing the engine, and when a mistake slips through, it can become a serious security bug. Rust is designed so that the compiler rules out that whole class of problem in safe code. Lela leans on that. According to the project, about 91.7% of its code is safe Rust.
The rest is spelled out openly, which I appreciate. Around 3.8% uses Rust's unsafe keyword, covering the memory manager, process control, and two JIT modules. Another 4.5% makes calls into C libraries such as PCRE2, libxml2, SQLite, OpenSSL, curl, and ICU. Those parts carry the same exposure that PHP has with those libraries. It's a refreshingly honest accounting, and it's the kind of detail that makes me trust a project more.
The site also points at a recent example. It says the two PHP bugs fixed in October 2026 (the PHP2Shell flaws) were memory errors that don't affect Lela. That's a nice illustration of the idea, though it's also worth remembering that no engine is bug-free, and Lela asks security reports to be sent privately through GitHub.
How to try it
Lela installs next to PHP as its own binary, so trying it doesn't disturb your existing setup. On a supported machine, the install is a single line, followed by a version check:
curl -fsSL https://lelaphp.dev/install.sh | sh
lela --version
From there, anywhere you'd normally type php, you can type lela. A fun first experiment is your test suite:
# Your usual way
php vendor/bin/phpunit
# The same tests, run on Lela
lela vendor/bin/phpunit
If you'd rather use containers, the project publishes Docker images under ghcr.io/lelaphp/lela, in three flavors: a CLI image, an FPM image (port 9000), and an Apache image (port 80). Each is built for both linux/amd64 and linux/arm64. For example:
docker pull ghcr.io/lelaphp/lela:cli
Prefer to build it yourself? The README walks through building from source with Cargo:
cargo build --release
If you only want the command-line binary, build just that host with cargo build --release -p php_sapi_cli. The result is target/release/lela.
There's also a nice bit of structure under the hood. The repository separates its hosts into their own crates, so you get a CLI (lela), a CGI host (lela-cgi), and an FPM host (lela-fpm), the same shapes PHP developers already know.
How fast is it?
Here's where I want to give the project credit for straight talk. Lela's own site says it is not faster than PHP yet. It publishes its numbers as multiples of PHP's results, where lower is better:
| Workload | Wall time vs PHP | Peak memory vs PHP |
|---|---|---|
| Empty program start-up | 0.54x | 1.02x |
| Composer install (from lock file) | 1.67x | 1.44x |
| Symfony demo page | 2.28x | 1.41x |
| Laravel new-app page | 2.67x | 1.69x |
| WordPress rendered page | 2.16x | 1.26x |
So start-up is already quicker, and real-world pages currently take a couple of times longer than on PHP. That's a normal place for an alpha engine to be, and the fact that Lela runs Laravel, Symfony, and WordPress pages at all is the headline. Compatibility comes first, and speed can follow.
Meet the pangolin
Every good project needs a mascot, and Lela's is a pangolin. The site greets you with the tagline "Meet Lela, the newest member of the PHP family," which is a friendly way to say this engine isn't here to fight PHP. It's here to join the family.
Fitting, really. A pangolin is armored, careful, and hard to knock over, and that's the spirit of a memory-safe engine.
Should you care?
Yes, for a few reasons.
First, it's a real, living example of a PHP engine that isn't the one we've always had. Having more than one serious implementation can make the whole language stronger, because every difference between engines is a chance to find and fix an edge case.
Second, the memory-safety angle is a big deal for a language that powers so much of the web. Even if you never run Lela in production, the ideas behind it are worth watching.
Third, it's a great weekend experiment. Install it, run your test suite, and see what happens. If something breaks, you've found a useful bug report. If everything passes, you've just run your PHP app on a Rust engine, which is a pretty fun thing to say.
A word of caution before you go all in: Lela is alpha software. Treat it as a project to test, follow, and encourage, and keep your production servers on PHP for now.
Where to learn more
The best places to start are the project site and the GitHub repository, both linked below. The repository also links to its design documents, if you want to see how the engine is put together.
PHP keeps surprising us, and this is one of the nicest surprises of the year. Welcome to the family, Lela.
References
- Lela project site: https://lelaphp.dev/
- Lela on GitHub (README and repository): https://github.com/lelaphp/lela