Esc
ZealPHP Documentation
Two surfaces, one source of truth. 25 narrative guides
walk through each subsystem with worked examples; the
API reference is auto-generated from
src/ docblocks and covers every public method, property,
and class.
Want a guided learning experience? Head over to the Learn section for step-by-step tutorials.
Getting started
- Getting Started Install PHP/OpenSwoole/ext-zealphp, boot your first server.
- Directory Structure Repo layout — where routes, APIs, templates, and src/ live.
- Runtime Architecture Request lifecycle, lifecycle setters (v0.2.27 safety throw), mode matrix.
Routing & responses
- Routing route(), nsRoute, nsPathRoute, patternRoute + parameter injection.
- API Layer ZealAPI file-based REST, v0.2.25 auth hooks.
- Error Handling setErrorHandler, ext-zealphp overrides, recursion guard, content-negotiated 5xx.
- Templates & Rendering render / renderToString / renderStream / include / fragment.
- HTMX isHtmx() + HtmxResponse, App::renderHtmx(), fragments, hx-boost — the full hypermedia surface.
Surfaces
- Streaming yield-based SSR, stream(), sse(), renderStream.
- WebSocket App::ws(), per-worker fd map, frame opcodes, cross-worker broadcast.
- WSRouter Production Hardening federated WebSocket rooms — capacity, auth, backpressure, stats.
- Tasks & Concurrency go(), task workers, App::tick/after, coproc().
- Middleware & Auth The full PSR-15 middleware catalog + common Apache/nginx behavior coverage.
Operations
- Deployment systemd unit, CLI flags, PID files, Docker, OPcache tuning.
- CLI Reference php app.php start/stop/restart/status/logs, ports, PID files, --dev.
- Dev Hot-Reload App::devReload() / ZEALPHP_DEV=1 / php app.php --dev — routes reload, no restart.
- FastCGI Backends Front php-fpm or any FCGI server — cgiMode('fcgi') + registerCgiBackend() for custom upstreams.
- Environment Variables Canonical reference for every ZEALPHP_* variable — defaults, scope, semantics.
- Fuzzing slowhttptest, radamsa, gabbi — HTTP framing & conformance fuzzing.
- Security Research Vulnerability classes (UAF / cross-tenant leak / unbounded leak) + the ASAN & Valgrind methodology for auditing the per-coroutine isolation runtime.
Background
- Apache Parity What Apache features port — and what doesn't.
- Compatibility Database Per-app coroutine-legacy compatibility grades from the real-world app sweep.
- Running Modern Apps Config recipes for Symfony / Laravel / WordPress on ZealPHP.
- Road to "Just Works" The honest scorecard: what already just works in coroutine-legacy, the conditional contract, and exactly what still stands in the way.
- Competitive Analysis vs FrankenPHP, RoadRunner, Octane, AMPHP.
- Standards & Roadmap PSR conformance + the v0.3.0+ roadmap.