ZealPHP on OpenSwoole
An async PHP framework tuned for coroutine I/O, SSR streaming, WebSocket, and low-latency services.
Built to keep requests lean and the event loop moving.
Quick Start
Pick the starter-project path or run the framework repo directly.
Everything you need
Every feature is a live running example — click any card to explore.
Routing
Flask-style routes with URL params, namespaces, and regex patterns. Reflection-based parameter injection.
Explore → HTTP\ResponseResponses
json(), redirect(), stream(), sse(), header(), cookie() — all coroutine-safe.
Explore → OpenSwooleCoroutines
go() + Channel for parallel async IO. Thousands of concurrent requests on a single worker.
Explore → SSR · SSEStreaming
SSR streaming via Generator yield, stream() callback, and Server-Sent Events.
Explore → App::ws()WebSocket
Real-time bi-directional with rooms, auth, binary frames, and heartbeat.
Explore → PSR-15Middleware
CORS, ETag/304, and custom PSR-15 middleware in any order.
Explore → uopz hooksSessions
Coroutine-safe sessions replacing all native session_*() functions via uopz.
Explore → Store · CounterStore
Cross-worker shared memory via OpenSwoole\Table. Lock-free atomic counters.
Explore → TimerTimers
App::tick/after for recurring tasks. Per-worker via onWorkerStart.
Explore → HTTP/1.1HTTP
HEAD, OPTIONS, 301/307 redirects, CORS, ETag, gzip — full HTTP/1.1.
Explore → implicit routesZealAPI
File-based REST endpoints. Drop a PHP file in api/ and it becomes a route.
Explore →Why ZealPHP?
No blocking
Every I/O call — file, DB, HTTP — yields to the event loop. OpenSwoole HOOK_ALL makes existing PHP libraries async automatically.
True coroutines
Not fake async with callbacks. Real coroutines with go() + Channel. Write synchronous code that runs concurrently.
PHP you already know
Superglobals, sessions, headers — all work via uopz overrides. Migrate existing apps without rewriting everything.
PSR standards
PSR-7 request/response, PSR-15 middleware. Drop in any PSR-15 middleware package.
Benchmark
Local quad-core /raw/bench sweep at c=1000 in bench mode: ZealPHP sustained 67k req/s, 21ms p90, and 0 failures on 4 workers.
Open source
MIT licensed. Maintained by the community. Built on OpenSwoole, one of PHP's most battle-tested async runtimes.