# bext-php
**Embedded PHP runtime for bext — custom SAPI linking libphp via Rust FFI.**
Part of the [bext](https://github.com/bext-stack/bext) stack.
```toml
[dependencies]
bext-php = "0.2"
```
## What this crate is
`bext-php` embeds the PHP runtime directly into bext via a custom SAPI
(Server API). PHP requests are handled in-process, without spawning
php-fpm subprocesses or even a fork. OPcache is preserved between requests
for near-zero latency on the hot path.
## Use cases
- **WordPress / Laravel / Symfony** hosting without a separate php-fpm.
- **Migrating from nginx + php-fpm** to a single bext binary.
- **Multi-tenant PHP** — isolation via bext's platform layer.
## Build requirements
You need `libphp` headers on the build machine. See the README in the
bext monorepo for platform-specific setup.
## License
MIT.
## See also
- [github.com/bext-stack/bext](https://github.com/bext-stack/bext) — the bext meta repo
- [Full ecosystem](https://github.com/bext-stack/bext#ecosystem-at-a-glance) — all bext crates at a glance