参考# 更新brew brew update brew upgrade
brew cleanup
# 列出已经安装的php版本
brew list | grep php
# 删除全部php包,重新安装 brew uninstall --force php56 php56-apcu php56-opcache php56-xdebug php56-yaml brew uninstall --force php70 php70-apcu php70-opcache php70-xdebug php70-yaml brew uninstall --force php71 php71-apcu php71-opcache php71-xdebug php71-yaml brew uninstall --force php72 php72-apcu php72-opcache php72-xdebug php72-yaml
brew cleanup
# 删除php旧配置
rm -Rf /usr/local/etc/php/*
# 预构建(brew仅支持7.2~8.1)
brew tap shivammathur/php
# 安装 brew install shivammathur/php/php@7.0 brew install shivammathur/php/php@7.1 brew install shivammathur/php/php@7.2 brew install shivammathur/php/php@7.3 brew install shivammathur/php/php@7.4
brew install shivammathur/php/php@8.0
# 配置文件地址 /usr/local/etc/php/7.0/php.ini /usr/local/etc/php/7.1/php.ini /usr/local/etc/php/7.2/php.ini /usr/local/etc/php/7.3/php.ini /usr/local/etc/php/7.4/php.ini
/usr/local/etc/php/8.0/php.ini
# 默认索引php版本
brew unlink php && brew link --overwrite --force php@7.3
# 检查版本 php -v
# php安装拓展 pecl install redis pecl install mongodb pecl install rabbitmq-c
pecl install amqp + rabbitmq-c路径
# php查看拓展 php -m # 关闭/重启php服务 sudo killall php-fpm
sudo php-fpm
发表评论 取消回复