PHPackages                             runtime/swoole - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. runtime/swoole

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

runtime/swoole
==============

Swoole runtime

1.0.0(5mo ago)56179.7k—6%92MITPHPPHP &gt;=8.1

Since Apr 29Pushed 5mo ago5 watchersCompare

[ Source](https://github.com/php-runtime/swoole)[ Packagist](https://packagist.org/packages/runtime/swoole)[ GitHub Sponsors](https://github.com/nyholm)[ RSS](/packages/runtime-swoole/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (6)Versions (9)Used By (2)

Swoole Runtime
==============

[](#swoole-runtime)

A runtime for [Swoole](https://www.swoole.com/).

If you are new to the Symfony Runtime component, read more in the [main readme](https://github.com/php-runtime/runtime).

Installation
------------

[](#installation)

```
composer require runtime/swoole

```

Usage
-----

[](#usage)

Define the environment variable `APP_RUNTIME` for your application.

```
APP_RUNTIME=Runtime\Swoole\Runtime

```

### Pure PHP

[](#pure-php)

```
// public/index.php

use Swoole\Http\Request;
use Swoole\Http\Response;

require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';

return function () {
    return function (Request $request, Response $response) {
        $response->header("Content-Type", "text/plain");
        $response->end("Hello World\n");
    };
};
```

### Symfony

[](#symfony)

```
// public/index.php

use App\Kernel;

require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';

return function (array $context) {
    return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
```

Using Options
-------------

[](#using-options)

You can define some configurations using Symfony's Runtime [`APP_RUNTIME_OPTIONS` API](https://symfony.com/doc/current/components/runtime.html#using-options).

OptionDescriptionDefault`host`The host where the server should binds to (precedes `SWOOLE_HOST` environment variable)`127.0.0.1``port`The port where the server should be listing (precedes `SWOOLE_PORT` environment variable)`8000``mode`Swoole's server mode (precedes `SWOOLE_MODE` environment variable)`SWOOLE_PROCESS``settings`All Swoole's server settings ([wiki.swoole.com/en/#/server/setting](https://wiki.swoole.com/en/#/server/setting) and [wiki.swoole.com/en/#/http\_server?id=configuration-options](https://wiki.swoole.com/en/#/http_server?id=configuration-options))`[]````
// public/index.php

use App\Kernel;

$_SERVER['APP_RUNTIME_OPTIONS'] = [
    'host' => '0.0.0.0',
    'port' => 9501,
    'mode' => SWOOLE_BASE,
    'settings' => [
        'worker_num' => swoole_cpu_num() * 2,
        'enable_static_handler' => true,
        'document_root' => dirname(__DIR__) . '/public'
    ],
];

require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';

return function (array $context) {
    return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
```

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance73

Regular maintenance activity

Popularity46

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~241 days

Recently: every ~389 days

Total

8

Last Release

152d ago

Major Versions

0.4.0 → 1.0.02025-12-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/401ccc5eea13c60cf807ae982af00e368e2166e2f26d8eb541dcd881a57385bc?d=identicon)[Nyholm](/maintainers/Nyholm)

---

Top Contributors

[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (16 commits)")[![piku235](https://avatars.githubusercontent.com/u/1687758?v=4)](https://github.com/piku235 "piku235 (4 commits)")[![leocavalcante](https://avatars.githubusercontent.com/u/183722?v=4)](https://github.com/leocavalcante "leocavalcante (3 commits)")[![thecaliskan](https://avatars.githubusercontent.com/u/13554944?v=4)](https://github.com/thecaliskan "thecaliskan (2 commits)")[![alexander-schranz](https://avatars.githubusercontent.com/u/1698337?v=4)](https://github.com/alexander-schranz "alexander-schranz (2 commits)")[![CViniciusSDias](https://avatars.githubusercontent.com/u/6991415?v=4)](https://github.com/CViniciusSDias "CViniciusSDias (1 commits)")[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (1 commits)")[![chalasr](https://avatars.githubusercontent.com/u/7502063?v=4)](https://github.com/chalasr "chalasr (1 commits)")[![RickySu](https://avatars.githubusercontent.com/u/248728?v=4)](https://github.com/RickySu "RickySu (1 commits)")[![mleczakm](https://avatars.githubusercontent.com/u/3474636?v=4)](https://github.com/mleczakm "mleczakm (1 commits)")

---

Tags

runtimeswoole

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/runtime-swoole/health.svg)

```
[![Health](https://phpackages.com/badges/runtime-swoole/health.svg)](https://phpackages.com/packages/runtime-swoole)
```

###  Alternatives

[bref/symfony-bridge

Makes Symfony work on AWS Lambda with Bref

491.7M5](/packages/bref-symfony-bridge)[mapbender/mapbender

Mapbender library

10117.4k5](/packages/mapbender-mapbender)[runtime/bref

Bref runtime

19107.4k](/packages/runtime-bref)[runtime/react

ReactPHP runtime

185.3k1](/packages/runtime-react)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
