首页 > 代码库 > Mac——homebrew安装PHP环境

Mac——homebrew安装PHP环境

1.安装homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2.安装nginx

brew install nginx
nginx -s reload|reopen|stop|quit #重新加载配置|重启|停止|退出 nginx

  

nginx -t #测试配置是否有语法错误

 

如果提示pid丢失的话,就用这句话

 

nginx -c "/usr/local/etc/nginx/nginx.conf"

3.安装PHP7

brew install php70 --without-apache --with-fpm

  /usr/local/sbin/php5x-fpm {start|restart|stop}

4.安装mysql

brew install mysql 

  cp /usr/local/opt/mysql/support-files/my-default.cnf /etc/my.cnf

brew services start mysql (启动)
brew services stop mysql (停止)

Mac——homebrew安装PHP环境