1店茶,安裝 homebrew
2,安裝 PHP 7.2劫恒,autoconf贩幻,openssl,redis
brew install php@7.2
brew install autoconf
brew install openssl
brew install redis
3两嘴,下載 hiredis丛楚,解壓后進入相應(yīng)目錄
make && make install
4,下載 swoole憔辫,解壓后進入相應(yīng)目錄
/usr/local/Cellar/php@7.2/7.2.16/bin/phpize
./configure --with-php-config=/usr/local/Cellar/php@7.2/7.2.16/bin/php-config --enable-mysqlnd --enable-openssl --with-openssl-dir=/usr/local/opt/openssl
make && make install
cd /usr/local/etc/php/7.2
vim php.ini
5鸯檬,在php.ini 文件中添加:extension=swoole
6,調(diào)整php版本
vim ~/.bash_profile
添加:export PATH=/usr/local/Cellar/php@7.2/7.2.16/bin:$PATH
source ~/.bash_profile
7螺垢,驗證
php -m
或者
php --ri swoole