PHPackages                             zanphp/zan - 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. zanphp/zan

ActiveLibrary

zanphp/zan
==========

v0.1.0(9y ago)1.4k596233[2 issues](https://github.com/youzan/zanphp/issues)PHP

Since Jan 7Pushed 8y ago126 watchersCompare

[ Source](https://github.com/youzan/zanphp)[ Packagist](https://packagist.org/packages/zanphp/zan)[ RSS](/packages/zanphp-zan/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)DependenciesVersions (8)Used By (0)

[![有赞logo](https://camo.githubusercontent.com/a03f8e264d056fb320d5254be74c70c20a6fb66c397f59b18f7cdaf2cdee0eb2/68747470733a2f2f696d672e797a63646e2e636e2f7075626c69635f66696c65732f323031372f30322f30392f65383461613863626266373835323638386338363231386331663362626631372e706e67)](https://github.com/youzan/)

 [![zanphp logo](https://github.com/youzan/zanphp.io/raw/master/src/img/zan-logo-small@2x.png?raw=true)](https://github.com/youzan/zanphp.io/blob/master/src/img/zan-logo-small@2x.png?raw=true)

基于 PHP 协程的网络服务框架，提供最简单的方式开发面向 C10K+ 的高并发SOA服务和RPC服务。

每天为2,000+个服务提供300,000,000+次访问量支持，广泛应用于有赞各项业务。

[![License](https://camo.githubusercontent.com/5e25f857ea70d6e61023befad1d4195a9196c47ce3e73e4ef77a0d8e2e2e98f3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d6d69742d626c75652e737667)](LICENSE)[![Build Status](https://camo.githubusercontent.com/320518f095eaed19e98ae41dc8e67bfd3a009b8ad8e4799e876996b3964a9e13/68747470733a2f2f7472617669732d63692e6f72672f796f757a616e2f7a616e7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/youzan/zanphp)

核心特性
----

[](#核心特性)

1. 基于 `yield` 实现了独立堆栈的协程
2. 类似于 Golang 的并发编程模型实现
3. 基于 [zan](https://github.com/youzan/zan) 提供异步非阻塞I/O服务
4. 连接池支持（内置 MySQL、Redis、syslog 等多种组件）
5. 类似 Golang 的 defer 机制解决由于异常导致的资源未释放、锁未释放的问题
6. 可继承的View布局及组件化支持，方便完成 bigPipe/bigRender/首屏加载优化等不同的渲染方式
7. 基于模型驱动的 SQLMap，实现了 SQL 的快速定位及方便的 sharding、cache 支持
8. 提供类似于 [Laravel](https://github.com/laravel/laravel) 的 middleware(Filters &amp; Terminators) 机制
9. Di及单元测试的良好支持
10. 完整的RPC远程服务调用方案

框架定位
----

[](#框架定位)

ZanPHP 的定位是高并发 Web 服务或业务中间件。

ZanPHP既可以满足创业公司或者个人建站的需求，也可以满足服务化架构下的框架需求。

ZanPHP 参考了很多 Golang 特性，不过目的绝不是为了替换掉 Golang。

PHP 在业务系统开发上的优势明显，而 Golang 相信会是将来系统编程的霸主。

ZanPHP 和 Golang 的边界是：ZanPHP做业务系统；Golang 做平台系统（中间件或基础服务组件）。

而 ZanPHP 和 Golang 编程模型的驱近，是希望能给PHP程序员一个更好的桥梁到Golang。

理想的技术栈是：ZanPHP + Go + 少量的C/C++。

当然对于致力于终身coding的码农来说：Java依然是很难跨过去的坎。

官方文档
----

[](#官方文档)

Zan PHP 的文档仓库地址：[zanphp-doc](https://github.com/youzan/zanphp-doc)。

在线查看文档 [http://zanphpdoc.zanphp.io/ ✈](http://zanphpdoc.zanphp.io/)

常用链接
----

[](#常用链接)

- [zan-doc](https://github.com/youzan/zanphp-doc) - Zan PHP 开发者文档
- [zan-installer](https://github.com/youzan/zan-installer) - Zan PHP 脚手架工具
- [zanhttp](https://github.com/youzan/zanhttpdemo) - Zan PHP HTTP demo
- [zantcp](https://github.com/youzan/zantcpdemo) - Zan PHP TCP demo
- [PHP异步编程: 手把手教你实现co与Koa](https://github.com/youzan/php-co-koa)

官方交流渠道
------

[](#官方交流渠道)

- 官网：[点我进入](http://zanphp.io)
- 官方交流QQ群：115728122

捐赠我们
----

[](#捐赠我们)

请点击 -&gt; [捐赠通道](http://zanphp.io/donate)

License
-------

[](#license)

[Zan PHP 框架](https://github.com/youzan/zan)基于 [MIT license](https://opensource.org/licenses/MIT) 进行开源。

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community35

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor3

3 contributors hold 50%+ of commits

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 ~212 days

Total

2

Last Release

3315d ago

Major Versions

v0.1.0 → 1.x-dev2017-04-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/57d7c0b1fed51b52222e9ad68b1f197c738149e3a78e69dedba2ced0c6a9c060?d=identicon)[zanphp](/maintainers/zanphp)

---

Top Contributors

[![goghcrow](https://avatars.githubusercontent.com/u/6487418?v=4)](https://github.com/goghcrow "goghcrow (488 commits)")[![winglechen](https://avatars.githubusercontent.com/u/241020?v=4)](https://github.com/winglechen "winglechen (367 commits)")[![zxcvdavid](https://avatars.githubusercontent.com/u/1303201?v=4)](https://github.com/zxcvdavid "zxcvdavid (271 commits)")[![agalwood](https://avatars.githubusercontent.com/u/1032175?v=4)](https://github.com/agalwood "agalwood (186 commits)")[![voidman](https://avatars.githubusercontent.com/u/238830?v=4)](https://github.com/voidman "voidman (157 commits)")[![suqiangithub](https://avatars.githubusercontent.com/u/8511749?v=4)](https://github.com/suqiangithub "suqiangithub (139 commits)")[![xxvholic](https://avatars.githubusercontent.com/u/5485134?v=4)](https://github.com/xxvholic "xxvholic (133 commits)")[![fxxkscript](https://avatars.githubusercontent.com/u/1597584?v=4)](https://github.com/fxxkscript "fxxkscript (53 commits)")[![vimac](https://avatars.githubusercontent.com/u/2765123?v=4)](https://github.com/vimac "vimac (36 commits)")[![touring](https://avatars.githubusercontent.com/u/7554659?v=4)](https://github.com/touring "touring (7 commits)")[![xhjcehust](https://avatars.githubusercontent.com/u/6275706?v=4)](https://github.com/xhjcehust "xhjcehust (6 commits)")[![Sxdd](https://avatars.githubusercontent.com/u/11328355?v=4)](https://github.com/Sxdd "Sxdd (5 commits)")[![sukui](https://avatars.githubusercontent.com/u/2092717?v=4)](https://github.com/sukui "sukui (2 commits)")[![znddzxx112](https://avatars.githubusercontent.com/u/8016409?v=4)](https://github.com/znddzxx112 "znddzxx112 (2 commits)")[![sunjun-qima](https://avatars.githubusercontent.com/u/13310573?v=4)](https://github.com/sunjun-qima "sunjun-qima (2 commits)")[![zhuguangyao](https://avatars.githubusercontent.com/u/1234097?v=4)](https://github.com/zhuguangyao "zhuguangyao (1 commits)")[![Daryl-L](https://avatars.githubusercontent.com/u/5457564?v=4)](https://github.com/Daryl-L "Daryl-L (1 commits)")[![netroby](https://avatars.githubusercontent.com/u/154278046?v=4)](https://github.com/netroby "netroby (1 commits)")[![moolex](https://avatars.githubusercontent.com/u/1132321?v=4)](https://github.com/moolex "moolex (1 commits)")[![delai](https://avatars.githubusercontent.com/u/1296212?v=4)](https://github.com/delai "delai (1 commits)")

---

Tags

asynciohigh-performancephprpcsoayieldzanphp

### Embed Badge

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

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

PHPackages © 2026

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