Swoole
Coroutine-based concurrency library for PHP
From https://github.com/swoole/swoole-src.
macOS
With https://brew.sh
sh
brew install pcre2Check versions
sh
ls /opt/homebrew/Cellar/pcre2/
ls /opt/homebrew/Cellar/php/Change below command versions
sh
ln -s /opt/homebrew/Cellar/pcre2/10.42/include/pcre2.h /opt/homebrew/Cellar/php/8.2.2/include/php/ext/pcre/pcre2.hInstall with default options
sh
pecl install swooleLinux
Install with all options
sh
pecl install swooleFind php.ini file
sh
php -i | grep php.iniEnable extension in php.ini (around line 900). Change PHP version if needed.
sh
sudo vim /etc/php/8.2/cli/php.inish
extension=swoole.sosh
php -i | grep php.ini # check the php.ini file location
sudo echo "extension=swoole.so" >> php.ini # add the extension=swoole.so to the end of php.ini
php -m | grep swoole # check if the swoole extension has been enabled