PHP TRUE ASYNC brings native asynchronous programming to PHP core.
- true-async branch —
TrueAsync API
+PHP
core changes and related libraries - true-async-api branch —
TrueAsync API
only
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 Async
extension repository:to the
ext
directory 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-config
For 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 install
We can use
--enable-debug
to 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!