A PHP application server written in Rust
โ Rust ๐ 2026-06-16 ๐ค surdeus ๐๏ธ 2Hi all,
for the purpose of learning Rust I've started working on an early-stage project called FerrumPHP, and Iโd appreciate feedback on the architecture and some of the design decisions before it stabilizes further.
It's a PHP application server written in Rust. It embeds the Zend engine via ext-php-rs and serves HTTP requests through a custom SAPI implementation. It's meant to run behind a reverse-proxy rather than being a full-fledged web server.
Architecture in a few points:
- Hyper is used for the HTTP server, with a Tower service and tokio's mpsc channels to stream requests/responses and bridge async Rust with sync PHP worker threads
- One OS thread per PHP worker. Workers receive jobs via a crossbeam channel
- Each job carries a tracing::Span across thread boundaries
Feedback is most welcome on the bridging of async Rust with long running threads, PHP SAPI callback ownership patterns, Streaming design (Tokio โ crossbeam โ Zend bridge) or any obvious pitfalls I might be missing.
Here's the repo: GitHub - hwawshy/ferrumphp: A PHP Application Server written in Rust ยท GitHub
Many thanks in advance.
1 post - 1 participant
๐ท๏ธ Rust_feed