mac搭建mnmp服务器
作者:bin首先:安装brew
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
使用安装nginx服务器文件,
查找:nginx:brew search nginx 安装:brew install nginx
一、nginx安装:
brew安装目录:/usr/local/ nginx运行目录:/usr/local/var nginx配置文件目录:/usr/local/etc/nginx
启动服务,端口号改成80之后,使用sudo nginx -c /usr/local/etc/nginx/nginx.conf
1、普通用户无法使用1024以下端口。2、指定配置文件
安装mysql数据库
使用 brew install mysql 安装 使用 sudo mysql 进入数据库 设置密码 mysql> set password for root@localhost=password ('在这里填入root密码');
安装php
MAC本来就自带了 php,但是很多扩展没有安装,所以选择了重新安装php。
首先,我们需要安装第三方程序包。
brew tap homebrew/dupes brew tap josegonzalez/homebrew-php