Mac: How to Install homebrew, nginx, PHP and MySQL

1. Install homebrew

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

2. Install nginx

brew install nginx
nginx -s reload|reopen|stop|quit #Reload Configuration|Restart|Stop|Exit nginx

Nginx-t # tests the configuration for syntax errors
Use this sentence if it is prompted that the PID is missing
Nginx – c “/ usr/local/etc/nginx/nginx. Conf.” ”
nginx
Brew services start nginx
: brew services stop nginx
brew services restart nginx
: brew services restart nginx
: brew services restart nginx
: brew services restart nginx
: brew services restart nginx
3. Install PHP7

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

PHP
Brew services start PHP
: brew services stop PHP
brew services restart PHP
: brew services start PHP
: brew services stop PHP
: brew services restart PHP
4. Installation of mysql

brew install mysql

cp /usr/local/opt/mysql/support-files/my-default.cnf /etc/my.cnf
brew services start mysql (run)
brew services stop mysql (stop)
mysql
Run: brew services start mysql
Stop: brew services stop mysql
Restart: brew services restart mysql


Read More: