PHPackages                             swoole/phpx - 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. swoole/phpx

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

swoole/phpx
===========

C++ wrapper for Zend API

v2.1.0(1mo ago)847141031Apache-2.0C++CI failing

Since Aug 22Pushed 1mo ago71 watchersCompare

[ Source](https://github.com/swoole/phpx)[ Packagist](https://packagist.org/packages/swoole/phpx)[ RSS](/packages/swoole-phpx/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (6)Versions (6)Used By (1)

[![Swoole Logo](logo.png)](logo.png)
====================================

[](#)

[![Twitter](https://camo.githubusercontent.com/938a48bafad518c277315ee27ebefa0a0ca9f7cde918eef1820810964ff6e9f5/68747470733a2f2f62616467656e2e6e65742f62616467652f69636f6e2f747769747465723f69636f6e3d74776974746572266c6162656c)](https://twitter.com/phpswoole)[![Discord](https://camo.githubusercontent.com/155081771f1f717ebd6be59f0cb88fb4ac65ee4a70fec13715509f7e280fdd50/68747470733a2f2f62616467656e2e6e65742f62616467652f69636f6e2f646973636f72643f69636f6e3d646973636f7264266c6162656c)](https://discord.swoole.dev)[![Build Status](https://github.com/matyhtf/phpx/workflows/libphpx/badge.svg)](https://github.com/matyhtf/phpx/actions?query=workflow%3Alibphpx)[![License](https://camo.githubusercontent.com/1d48dd9fe6bf24b648040a29de372f089b9340226a4fb00214784dfb402cdda1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d617061636865322d626c75652e737667)](LICENSE)[![Latest Release](https://camo.githubusercontent.com/22f7562c52a318bba0347108dff68227ee0a71348346275c78ded9dbfa569ad1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f73776f6f6c652f706870782e737667)](https://github.com/swoole/phpx/releases/)[![Codecov](https://camo.githubusercontent.com/da77b9df00ef9c58e2ca959ac951ffc72dca1a80b76e8e1c238f417bc6505503/68747470733a2f2f636f6465636f762e696f2f67682f73776f6f6c652f706870782f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/swoole/phpx)

C++ wrapper for Zend API

Requirements
------------

[](#requirements)

- PHP 8.1 or later
- Linux/macOS/Windows
- GCC 4.8 or later
- Composer

Build phpx (bin)
----------------

[](#build-phpx-bin)

```
./build.sh
sudo cp bin/phpx /usr/local/bin
```

Build libphpx.so
----------------

[](#build-libphpxso)

```
cmake .
make -j 4
sudo make install
sudo ldconfig
```

Create Project
--------------

[](#create-project)

```
phpx create cpp_ext
```

Generate ArgInfo &amp; Function Entires
---------------------------------------

[](#generate-arginfo--function-entires)

```
php bin/gen_stub.php your_stub_dir
```

Build extension
---------------

[](#build-extension)

```
cd examples/cpp_ext
phpx build -v
sudo phpx install
```

Load your extension
-------------------

[](#load-your-extension)

Edit `php.ini`, add `extension=cpp_ext.so`

Run
---

[](#run)

```
php echo.php
```

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance89

Actively maintained with recent releases

Popularity32

Limited adoption so far

Community32

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 95.5% 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 ~54 days

Total

5

Last Release

53d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e1dea9261ba377a13a16e7e0f3883e73bda4094551ddea280e852f23a5d248c0?d=identicon)[Tianfeng.Han](/maintainers/Tianfeng.Han)

---

Top Contributors

[![matyhtf](https://avatars.githubusercontent.com/u/2017766?v=4)](https://github.com/matyhtf "matyhtf (508 commits)")[![owenliang](https://avatars.githubusercontent.com/u/7803472?v=4)](https://github.com/owenliang "owenliang (15 commits)")[![limingxinleo](https://avatars.githubusercontent.com/u/16648551?v=4)](https://github.com/limingxinleo "limingxinleo (2 commits)")[![Yurunsoft](https://avatars.githubusercontent.com/u/20104656?v=4)](https://github.com/Yurunsoft "Yurunsoft (2 commits)")[![kong36088](https://avatars.githubusercontent.com/u/11497913?v=4)](https://github.com/kong36088 "kong36088 (2 commits)")[![heyanlong](https://avatars.githubusercontent.com/u/3367958?v=4)](https://github.com/heyanlong "heyanlong (1 commits)")[![shiguangqi](https://avatars.githubusercontent.com/u/654869?v=4)](https://github.com/shiguangqi "shiguangqi (1 commits)")[![deminy](https://avatars.githubusercontent.com/u/865547?v=4)](https://github.com/deminy "deminy (1 commits)")

---

Tags

phpextensionembeddedZendAPI

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[rubix/tensor

A library and extension that provides objects for scientific computing in PHP.

2751.4M5](/packages/rubix-tensor)[memio/spec-gen

phpspec extension for better code generation

66204.3k28](/packages/memio-spec-gen)[phpxmlrpc/polyfill-xmlrpc

A pure-php reimplementation of the API exposed by the native XML-RPC extension

12369.8k2](/packages/phpxmlrpc-polyfill-xmlrpc)

PHPackages © 2026

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