Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        


Swoole Logo

[![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
```