swoole / phpx
C++ wrapper for Zend API
v2.0.3
2025-08-25 11:19 UTC
Requires
- league/climate: ^3.10
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.75
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2026-03-05 07:27:58 UTC
README
C++ wrapper for Zend API
Requirements
- PHP 8.1 or later
- Linux/macOS/Windows
- GCC 4.8 or later
- Composer
Build phpx (bin)
./build.sh sudo cp bin/phpx /usr/local/bin
Build libphpx.so
cmake .
make -j 4
sudo make install
sudo ldconfig
Create Project
phpx create cpp_ext
Generate ArgInfo & Function Entires
php bin/gen_stub.php your_stub_dir
Build extension
cd examples/cpp_ext
phpx build -v
sudo phpx install
Load your extension
Edit php.ini, add extension=cpp_ext.so
Run
php echo.php
