mac系统下git、mysql、nginx、php的环境搭建
安装homebrew
安装git
官网下载安装
安装git戳这里
下载完成按住control键再点击安装包,出现弹窗后点击打开。
通过homebrew安装
brew install git
安装mysql
brew install mysql
安装nginx
brew install inginx
- 一些nginx命令:
# 启动 nginx sudo brew services start nginx sudo nginx #安装后的nginx默认监听的端口是80端口 http://localhost # 关闭 nginx sudo brew services stop nginx # 重新加载 nginx nginx -s reload # 停止 nginx nginx -s stop # 查看版本,以及配置文件地址 nginx -V # 看版本 nginx -v # 重新加载配置|重启|快速停止|安全关闭nginx nginx -s reload|reopen|stop|quit # 帮助 nginx -h # 开启nginx之前应确保apache已经关闭 # 关闭apache sudo apachectl -k stop
安装php
Mac自带
# 查看自带版本 php -v