升级php
brew install php || brew upgrade php
如果php -v环境版本不正确:
brew info php
# 显示安装目录 /usr/local/opt/php@8.0
vim ~/.bash_profile
export PATH="/usr/local/opt/php@8.0/bin:/usr/local/opt/php@8.0/sbin:$PATH"
source ~/.bash_profile
安装swoole
git clone https://gitee.com/swoole/swoole.git
cd swoole/ && phpize
# brew install openssl && brew info openssl
./configure --with-php-config=/usr/local/opt/php@8.0/bin/php-config --with-openssl-dir=/usr/local/opt/openssl@1.1 --enable-http2 --enable-sockets
make && make install
echo 'extension=swoole' >> /usr/local/etc/php/8.0/php.ini