brew 安装

进入官网https://brew.sh/index_zh-cn.html

在终端执行

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

引入tap

brew tap homebrew/homebrew-php

安装php

brew install php71

在终端查看版本

php --verison

安装写扩展

# 加解密库 
brew install php71-mcrypt
# 性能加速 
brew install php71-opcache
# redis依赖扩展
brew install php71-redis
原文地址:https://www.cnblogs.com/linst/p/8351788.html