mac下安装php环境
1、homebrew ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 2、添加apache、php仓库 brew tap homebrew/apache brew tap homebrew/php 3、brew命令列表 brew update #更新源 brew search php56 #查找php5.6 brew install php56 #安装php5.6 brew options php56 #查看编译参数 brew tap xxxx #添加源 4、安装 brew install httpd24
brew install php70 --without-fpm --with-httpd --with-thread-safety
brew install mysql
5、配置文件路径 /usr/local/etc/
6、安装文件路径 /usr/local/Cellar/
7、启动服务
sudo apachectl start
mysql.server start
8、安装php拓展
brew install php70-igbinary --build-from-source
brew install php70-redis --build-from-source
9 php版本切换
brew unlink PHP-之前版本
brew link php-现在版本
sudo brew services stop php70
sudo brew services start php56