码迷,mamicode.com
首页 > 系统相关 > 详细

mac搭建mnmp环境

时间:2018-04-15 11:45:39      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:cal   pat   安装PHP5   mac   影响   bre   mongodb   其他   install   

brew安装nginx

brew install nginx

安装php56

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

安装php71

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安装mysql

brew install mysql

mac查看网络监听

netstat -nat | grep LISTEN

brew安装redis

brew install redis

brew安装redis扩展

brew install php71-redis

brew安装mongodb

brew install mongodb

brew安装mongodb扩展

brew install php71-mongodb

brew services启动程序

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

mac搭建mnmp环境

标签:cal   pat   安装PHP5   mac   影响   bre   mongodb   其他   install   

原文地址:https://www.cnblogs.com/spectrelb/p/8837007.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!