标签:cal pat 安装PHP5 mac 影响 bre mongodb 其他 install
brew install nginx
brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
brew install php56 --with-imap --with-tidy --with-debug --with-mysql --with-fpm
sudo vim ~/.zshrc
#在这个文件最后添加下列语句:
export PATH="$(brew --prefix php56)/bin:$PATH"
export PATH="$(brew --prefix php56)/sbin:$PATH"
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
#保存文件后,source下这个文件,使刚刚添加的环境变量生效
source ~/.zshrc
brew unlink php56 #清除php56的软链,此操作对软件本身毫无影响
brew install php71
切换环境:
brew unlink php56
brew link php71
sudo vim ~/.zshrc
#在这个文件最后添加下列语句:
export PATH="$(brew --prefix php71)/bin:$PATH"
export PATH="$(brew --prefix php71)/sbin:$PATH"
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
#保存文件后,source下这个文件,使刚刚添加的环境变量生效
source ~/.zshrc
brew install mysql
netstat -nat | grep LISTEN
brew install redis
brew install php71-redis
brew install mongodb
brew install php71-mongodb
brew services list #可以查看当前已管理的服务,并且可看到启动状态,然后可以通过 start,stop等启动和关闭对应软件
sudo brew services start nginx
其他方法启动nginx
sudo nginx
sudo nginx -s stop
sudo nginx -s reload
brew services start php71
brew services start mysql
brew services start redis
brew services start mongodb
标签:cal pat 安装PHP5 mac 影响 bre mongodb 其他 install
原文地址:https://www.cnblogs.com/spectrelb/p/8837007.html