https://github.com/swoole/phpx
C++ wrapper for Zend API
https://github.com/swoole/phpx
Last synced: 2 months ago
JSON representation
C++ wrapper for Zend API
- Host: GitHub
- URL: https://github.com/swoole/phpx
- Owner: swoole
- License: apache-2.0
- Created: 2017-05-18T08:30:22.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2026-03-26T09:22:27.000Z (3 months ago)
- Last Synced: 2026-03-27T03:24:53.136Z (3 months ago)
- Language: C++
- Homepage:
- Size: 1.36 MB
- Stars: 844
- Watchers: 71
- Forks: 103
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-php-extensions - php-x - cpp 开发 (扩展编写)
README
[](https://twitter.com/phpswoole)
[](https://discord.swoole.dev)
[](https://github.com/matyhtf/phpx/actions?query=workflow%3Alibphpx)
[](LICENSE)
[](https://github.com/swoole/phpx/releases/)
[](https://codecov.io/gh/swoole/phpx)
C++ wrapper for Zend API
## Requirements
- PHP 8.1 or later
- Linux/macOS/Windows
- GCC 4.8 or later
- Composer
## Build libphpx.so
```shell
cmake .
make -j 4
sudo make install
sudo ldconfig
```
## Create Project
```shell
# extension
composer create-project swoole/phpx-ext test
```
## Generate ArgInfo & Function Entires
```shell
php vendor/swoole/phpx/bin/gen_stub.php your_stub_dir
```
## Build extension
```shell
cd test
cmake .
make -j 4
make install
```
## Load your extension
Edit `php.ini`, add `extension=test.so`
## Run
```shell
php echo.php
```