1. Install mariadb for database
brew install mariadb
After install start mariadb
brew services start mariadb
Set default password to root user (substitute 'welcome' to your choice of password, but make it easy for this is only local setup)
mysqladmin -u root password 'welcome'
Test if can connect to root using newly set password
mysql -uroot -pwelcome
2. Install [email protected] using brew
brew install [email protected]
Start [email protected]
brew services start [email protected]
Check if correct php is running, should output php 5.6
which php
To make sure that [email protected] is always used when you execute commands with php
, you need to add this to your paths.
Create .bash_profile
file under ~
(~/.bash_profile
)
cd ~
touch .bash_profile
open .bash_profile
Paste this on the .bash_profile
file (content will differ if other php version is installed)
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
To conclude the change, save it and run command below
source ~/.bash_profile
Test if [email protected] is your current php version used
which php
/usr/local/opt/[email protected]/bin/php <-- should output this
3. Install nginx (for test domain on local)
brew install nginx
Starting nginx, do command below
sudo nginx
Password: <input your machine password>
Stopping nginx
sudo nginx -s stop
Password: <input your machine password>
Local development is set now.