Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swoole/PHP-X
💗 C++ wrapper for Zend API
https://github.com/swoole/PHP-X
Last synced: 23 days ago
JSON representation
💗 C++ wrapper for Zend API
- Host: GitHub
- URL: https://github.com/swoole/PHP-X
- Owner: swoole
- License: apache-2.0
- Created: 2017-05-18T08:30:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-22T11:10:04.000Z (about 1 year ago)
- Last Synced: 2024-08-05T02:01:18.287Z (5 months ago)
- Language: C++
- Homepage:
- Size: 440 KB
- Stars: 823
- Watchers: 71
- Forks: 102
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-swoole - PHP_X@matyhtf - C++ wrapper for Zend API (php扩展)
README
[![Build Status](https://github.com/matyhtf/phpx/workflows/libphpx/badge.svg)](https://github.com/matyhtf/phpx/actions?query=workflow%3Alibphpx)
[![License](https://img.shields.io/badge/license-apache2-blue.svg)](LICENSE)C++ wrapper for Zend API
## Requirements
- PHP 8.0 or later
- Linux/MacOS/Windows
- GCC 4.8 or later
- Composer## Build phpx (bin)
```shell
./build.sh
sudo cp bin/phpx /usr/local/bin
```## Build libphpx.so
```shell
cmake .
make -j 4
sudo make install
sudo ldconfig
```## Create Project
```shell
phpx create cpp_ext
```## Generate ArgInfo & Function Entires
```shell
php bin/gen_stub.php your_stub_dir
```## Build extension
```shell
cd examples/cpp_ext
phpx build -v
sudo phpx install
```## Load your extension
Edit `php.ini`, add `extension=cpp_ext.so`## Run
```shell
php echo.php
```