mac 安装php composer
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