mac-11.2.3安装php8.0 -swoole


升级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
,

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注