PHPackages                             mix/mix - 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. [Framework](/categories/framework)
4. /
5. mix/mix

ActiveFramework[Framework](/categories/framework)

mix/mix
=======

PHP CLI mode development framework

v3.0.30(3y ago)1.9k1.2k214[1 issues](https://github.com/mix-php/mix/issues)[2 PRs](https://github.com/mix-php/mix/pulls)Apache-2.0PHPPHP &gt;=7.3.0CI failing

Since Apr 2Pushed 1mo ago71 watchersCompare

[ Source](https://github.com/mix-php/mix)[ Packagist](https://packagist.org/packages/mix/mix)[ Docs](https://openmix.org/mix-php)[ RSS](/packages/mix-mix/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (20)Versions (68)Used By (0)Security (2)

Mix PHP
=======

[](#mix-php)

中文 | [English](README_EN.md)

MixPHP 是一个 PHP 命令行模式开发框架；基于 `Vega` 驱动的 HTTP 可以同时支持 Swoole、Swow、WorkerMan、FPM、CLI-Server 生态，并且可以无缝切换；`V3` 是一个高度解耦的版本，整体代码基于多个独立的模块构建，即便用户不使用我们的脚手架，也可以使用这些独立模块，并且全部模块都支持原生开发。例如：你可以只使用 mix/vega 来搭配 laravel orm 使用；可以在任意环境中使用 mix/database 和 mix/redis；可以使用 mix/grpc 原生代码编写 gRPC；所有的模块你可以像搭积木一样随意组合。

独立模块
----

[](#独立模块)

核心模块全部可独立使用，并且都支持原生代码开发。

- [mix/vega](src/vega) PHP 编写的 CLI 模式 HTTP 网络框架，支持 Swoole、Swow、WorkerMan、FPM、CLI-Server
- [mix/database](src/database) 可在各种环境中使用的轻量数据库，支持 FPM、CLI、Swoole、WorkerMan，可选的连接池 (协程)
- [mix/redis](src/redis) 可在各种环境中使用的 PHP Redis，支持 FPM、CLI、Swoole、WorkerMan，可选的连接池 (协程)
- [mix/redis-subscriber](src/redis-subscriber) 基于 Swoole 协程的 Redis 原生协议订阅库
- [mix/grpc](src/grpc) 基于 Swoole 协程的 PHP gRPC 库，包含 protoc 代码生成器、服务器、客户端
- [mix/websocket](src/websocket) 基于 Swoole 协程的 PHP WebSocket 服务器与客户端
- [mix/cli](src/cli) PHP 命令行交互指挥官
- [mix/worker-pool](src/worker-pool) 基于 Swoole 的协程池、工作池库
- [mix/validator](src/validator) 基于 PSR-7 的验证库
- [mix/event](src/event) 基于 PSR-14 标准的事件调度库
- [mix/init](src/init) 帮助执行类的静态初始化，通常用于预加载单例

服务器
---

[](#服务器)

支持多种服务器驱动，并且可以无缝切换。

- [PHP Built-in CLI-Server](examples/api-skeleton/composer.json#L8) `零扩展依赖` `热更新` `适合本机开发`
- [PHP-FPM](examples/api-skeleton/public/index.php) `热更新` `适合共享开发` `适合 admin 开发`
- [Swoole](examples/api-skeleton/composer.json#L9) `常驻内存` `兼容 composer 生态`
- [Swoole Coroutine](examples/api-skeleton/composer.json#L10) `常驻内存` `协程性能强劲`
- [Swow](examples/api-skeleton/composer.json#L11) `常驻内存` `纯C协程` `兼容 composer 生态`
- [WorkerMan](examples/api-skeleton/composer.json#L12) `常驻内存` `兼容 composer 生态`

开发文档
----

[](#开发文档)

- `V3.0` 1.[快速开始](#%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B) 2.[服务器](#%E6%9C%8D%E5%8A%A1%E5%99%A8) 3.[独立模块](#%E7%8B%AC%E7%AB%8B%E6%A8%A1%E5%9D%97)
- `V2.2`
- `V2.1`
- `V2.0`
- `V1.*`

快速开始
----

[](#快速开始)

提供了现成的脚手架，快速创建项目，立即产出。

- [编写一个 CLI 程序](examples/cli-skeleton#readme)

```
composer create-project --prefer-dist mix/cli-skeleton cli

```

- [编写一个 API 接口](examples/api-skeleton#readme)

```
composer create-project --prefer-dist mix/api-skeleton api

```

- [编写一个 Web 页面](examples/web-skeleton#readme)

```
composer create-project --prefer-dist mix/web-skeleton web

```

- [编写一个 WebSocket 服务](examples/websocket-skeleton#readme)

```
composer create-project --prefer-dist mix/websocket-skeleton websocket

```

- [编写一个 gRPC 接口](examples/grpc-skeleton#readme)

```
composer create-project --prefer-dist mix/grpc-skeleton grpc

```

性能测试
----

[](#性能测试)

- [TechEmpower Benchmark](https://www.techempower.com/benchmarks/#section=data-r21&test=db&l=zik073-6bj)

[![techempower-benchmark.png](techempower-benchmark.png)](techempower-benchmark.png)

- [Web Frameworks Benchmark](https://web-frameworks-benchmark.netlify.app/result?l=php)

[![web-frameworks-benchmark.png](web-frameworks-benchmark.png)](web-frameworks-benchmark.png)

推荐阅读
----

[](#推荐阅读)

- [MixPHP V3 开发流程体验 Swoole, Workerman, FPM, CLI-Server 多种运行模式介绍](https://zhuanlan.zhihu.com/p/398381870)
- [MixPHP V3 增加了 PHP-FPM、CLI-Server 的支持](https://zhuanlan.zhihu.com/p/394059925)
- [MixPHP V3 发布前的感想, 有哪些变化和特点](https://zhuanlan.zhihu.com/p/392558932)

技术交流
----

[](#技术交流)

知乎：
官方QQ群：[284806582](https://shang.qq.com/wpa/qunwpa?idkey=b3a8618d3977cda4fed2363a666b081a31d89e3d31ab164497f53b72cf49968a), [825122875](http://shang.qq.com/wpa/qunwpa?idkey=d2908b0c7095fc7ec63a2391fa4b39a8c5cb16952f6cfc3f2ce4c9726edeaf20) 敲门暗号：phper

Golang 框架
---------

[](#golang-框架)

OpenMix 同时还有 Golang 生态的框架

-

License
-------

[](#license)

Apache License Version 2.0,

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance59

Moderate activity, may be stable

Popularity43

Moderate usage in the ecosystem

Community32

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 97.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 ~28 days

Recently: every ~158 days

Total

65

Last Release

1118d ago

Major Versions

v1.x-dev → v2.0.1-Beta22018-12-27

v2.2.18 → v3.0.62021-07-16

PHP version history (5 changes)v1.0.3PHP &gt;=5.4.0

v1.0.15PHP &gt;=5.5.0

v1.0.19PHP &gt;=7.0.0

v2.1.0-betaPHP &gt;=7.2.0

v3.0.27PHP &gt;=7.3.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16074765?v=4)[LIU JIAN](/maintainers/onanying)[@onanying](https://github.com/onanying)

---

Top Contributors

[![onanying](https://avatars.githubusercontent.com/u/16074765?v=4)](https://github.com/onanying "onanying (2578 commits)")[![cexll](https://avatars.githubusercontent.com/u/26520956?v=4)](https://github.com/cexll "cexll (37 commits)")[![PandaLIU-1111](https://avatars.githubusercontent.com/u/26201936?v=4)](https://github.com/PandaLIU-1111 "PandaLIU-1111 (6 commits)")[![huangdijia](https://avatars.githubusercontent.com/u/8337659?v=4)](https://github.com/huangdijia "huangdijia (4 commits)")[![SyanH](https://avatars.githubusercontent.com/u/6157072?v=4)](https://github.com/SyanH "SyanH (4 commits)")[![bbuugg](https://avatars.githubusercontent.com/u/64066545?v=4)](https://github.com/bbuugg "bbuugg (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![quhaowk](https://avatars.githubusercontent.com/u/42995157?v=4)](https://github.com/quhaowk "quhaowk (3 commits)")[![writethesky](https://avatars.githubusercontent.com/u/7201443?v=4)](https://github.com/writethesky "writethesky (2 commits)")[![YianAndCode](https://avatars.githubusercontent.com/u/6998693?v=4)](https://github.com/YianAndCode "YianAndCode (2 commits)")[![sy-records](https://avatars.githubusercontent.com/u/33931153?v=4)](https://github.com/sy-records "sy-records (2 commits)")[![jiafuAI](https://avatars.githubusercontent.com/u/199593169?v=4)](https://github.com/jiafuAI "jiafuAI (1 commits)")[![joanhey](https://avatars.githubusercontent.com/u/249085?v=4)](https://github.com/joanhey "joanhey (1 commits)")[![NHZEX](https://avatars.githubusercontent.com/u/14545600?v=4)](https://github.com/NHZEX "NHZEX (1 commits)")[![yupeng2015](https://avatars.githubusercontent.com/u/10594818?v=4)](https://github.com/yupeng2015 "yupeng2015 (1 commits)")[![sjfxy](https://avatars.githubusercontent.com/u/31093165?v=4)](https://github.com/sjfxy "sjfxy (1 commits)")

---

Tags

clicoroutineframeworkgrpchttpmixmix-phpmixphpswoolewebsokcetworkermanframeworkswoolecoroutinemix

### Embed Badge

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

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

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.8k18.5M1.6k](/packages/cakephp-cakephp)[laravel/framework

The Laravel Framework.

34.6k509.9M17.0k](/packages/laravel-framework)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)

PHPackages © 2026

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