PHP TRUE ASYNC brings native asynchronous programming to PHP core.
- true-async branch —
TrueAsync API+PHPcore changes and related libraries - true-async-api branch —
TrueAsync APIonly
php-async — Extension implementing the TrueAsync API
php-true-async-rfc — RFC and documentation
-
Clone the PHP repository:
for example, basic directory name is
php-src:git clone https://github.com/true-async/php-src -b true-async-api ./php-src -
Clone the
True Asyncextension repository:to the
extdirectory of your PHP source:git clone https://github.com/true-async/php-async ./php-src/ext/async -
Install PHP development tools:
Make sure you have the necessary development tools installed. On Debian/Ubuntu, you can run:
sudo apt-get install php-dev build-essential autoconf libtool pkg-configFor macOS, you can use Homebrew:
brew install autoconf automake libtool pkg-config -
Install LibUV::
Please see the LibUV installation guide
-
Configure and build:
./buildconf ./configure --enable-async make && sudo make installWe can use
--enable-debugto enable debug mode, which is useful for development.
-
Install php-sdk:
Download and set up php-sdk for building PHP extensions on Windows. -
Install and build LibUV:
You can use vcpkg or build libuv from source. -
Copy LibUV files to PHP SDK directories:
1. Copy everything from 'libuv\include' to '%PHP_SDK_PATH%\deps\include\libuv\' 2. Copy 'libuv.lib' to '%PHP_SDK_PATH%\deps\lib\'%PHP_SDK_PATH%is your php-sdk installation root. -
Configure and build the extension with PHP:
cd \path\to\php-src buildconf configure --enable-async nmake
PHP TRUE ASYNC — making async a standard in PHP!