PHPackages                             runtime/swoole-nyholm - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. runtime/swoole-nyholm

ActiveLibrary[HTTP &amp; Networking](/categories/http)

runtime/swoole-nyholm
=====================

Swoole runtime with nyholm/psr7

1.0.0(6mo ago)4487MITPHPPHP &gt;=8.1

Since Jul 18Pushed 6mo ago3 watchersCompare

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

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

Swoole Runtime with nyholm/psr7
===============================

[](#swoole-runtime--with-nyholmpsr7)

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-nyholm

```

Usage
-----

[](#usage)

Define the environment variable `APP_RUNTIME` for your application.

```
APP_RUNTIME=Runtime\SwooleNyholm\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");
    };
};
```

### PSR

[](#psr)

```
// public/index.php

use Nyholm\Psr7\Response;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;

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

class App implements RequestHandlerInterface {
    public function handle(ServerRequestInterface $request): ResponseInterface {
        $name = $request->getQueryParams()['name'] ?? 'World';
        return new Response(200, ['Server' => 'swoole-runtime'], "Hello, $name!");
    }
}

return function(): RequestHandlerInterface {
    return new App();
};
```

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

43

—

FairBetter than 89% of packages

Maintenance67

Regular maintenance activity

Popularity17

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 64.3% 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 ~537 days

Total

4

Last Release

196d ago

Major Versions

0.2.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 (9 commits)")[![thecaliskan](https://avatars.githubusercontent.com/u/13554944?v=4)](https://github.com/thecaliskan "thecaliskan (2 commits)")[![chalasr](https://avatars.githubusercontent.com/u/7502063?v=4)](https://github.com/chalasr "chalasr (1 commits)")[![CViniciusSDias](https://avatars.githubusercontent.com/u/6991415?v=4)](https://github.com/CViniciusSDias "CViniciusSDias (1 commits)")[![pistej](https://avatars.githubusercontent.com/u/9282821?v=4)](https://github.com/pistej "pistej (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[bref/bref

Bref is a framework to write and deploy serverless PHP applications on AWS Lambda.

3.4k10.6M67](/packages/bref-bref)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M563](/packages/shopware-core)[moonshine/moonshine

Laravel administration panel

1.3k253.1k79](/packages/moonshine-moonshine)[jaxon-php/jaxon-core

Jaxon is an open source PHP library for easily creating Ajax web applications

74149.4k30](/packages/jaxon-php-jaxon-core)[fluffydiscord/roadrunner-symfony-bundle

Roadrunner runtime for Symfony

1911.7k](/packages/fluffydiscord-roadrunner-symfony-bundle)

PHPackages © 2026

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