PHPackages                             wilbur-yu/hyperf-server-switch - 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. wilbur-yu/hyperf-server-switch

ActiveLibrary

wilbur-yu/hyperf-server-switch
==============================

0.0.2(4y ago)1873MITPHPPHP &gt;=8.0

Since Feb 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/wilbur-yu/hyperf-server-switch)[ Packagist](https://packagist.org/packages/wilbur-yu/hyperf-server-switch)[ RSS](/packages/wilbur-yu-hyperf-server-switch/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (12)Versions (3)Used By (0)

> 搬运自: [如何让 Hyperf 只启动一个服务](https://zhuanlan.zhihu.com/p/342893609)

安装
==

[](#安装)

```
composer require wilbur-yu/hyperf-server-switch
```

配置
==

[](#配置)

config/autoload/server.php

```
'servers' => [
        [
            'name'      => 'http',
            'type'      => Server::SERVER_HTTP,
            'host'      => '127.0.0.1',
            'port'      => 9801,
            'sock_type' => SWOOLE_SOCK_TCP,
            'callbacks' => [
                Event::ON_REQUEST => [Hyperf\HttpServer\Server::class, 'onRequest'],
            ],
        ],
        [
            'name'      => 'http2',
            'type'      => Server::SERVER_HTTP,
            'host'      => '0.0.0.0',
            'port'      => 9502,
            'sock_type' => SWOOLE_SOCK_TCP,
            'callbacks' => [
                Event::ON_REQUEST => ['HttpServer2', 'onRequest'],
            ],
        ],
    ],
```

使用
==

[](#使用)

1. 启动所有 server

```
php bin/hyperf.php start
```

2. 启动某个 server

```
php bin/hyperf.php -S http

// or

php bin/hyperf.php -S http2
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~428 days

Total

2

Last Release

1475d ago

PHP version history (2 changes)0.0.1PHP &gt;=7.3

0.0.2PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2ba6eb722ff24398c7686e121aceabdc2265c883acb6685fa9abc9291f373e2b?d=identicon)[wilbur.yu](/maintainers/wilbur.yu)

---

Top Contributors

[![wilbur-yu](https://avatars.githubusercontent.com/u/7148309?v=4)](https://github.com/wilbur-yu "wilbur-yu (4 commits)")

---

Tags

phphyperf

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/wilbur-yu-hyperf-server-switch/health.svg)

```
[![Health](https://phpackages.com/badges/wilbur-yu-hyperf-server-switch/health.svg)](https://phpackages.com/packages/wilbur-yu-hyperf-server-switch)
```

###  Alternatives

[hyperf/swow-skeleton

A coroutine framework that focuses on hyperspeed and flexible, specifically use for build microservices and middlewares.

514.5k](/packages/hyperf-swow-skeleton)[hyperf/odin

425.9k](/packages/hyperf-odin)

PHPackages © 2026

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