Swoole is an event-driven, asynchronous, coroutine-based concurrency library with high performance for PHP.


$server = new Swoole\Http\Server('', 9501);

$server->on('start', function () {
    echo "Listening at http://localhost:9501\n";

$server->on('request', function ($req, $res) {
    $res->end('Hello, World!');


Getting started

Swoole is distributed as any other PHP extension. It is easy to get started.


pecl install swoole

Or run with Docker:

docker run --rm phpswoole/swoole "php --ri swoole"