1、先安装brew
参考地址:https://zhuanlan.zhihu.com/p/111014448
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
2、安装php
brew search php brew install php
3、安装composer
1.下载安装脚本 composer-setup.php 到当前目录 php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" 2.安装 php composer-setup.php 3.删除安装脚本 php -r "unlink('composer-setup.php');" 4.将命令添加到全局 sudo mv composer.phar /usr/local/bin/composer
标签:https,setup,mac,composer,brew,php,安装 From: https://www.cnblogs.com/tiantianyang/p/16748713.html