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 php@5.6 using brew
brew install php@5.6
Start php@5.6
brew services start php@5.6
Check if correct php is running, should output php 5.6
which php
To make sure that php@5.6 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/php@5.6/bin:$PATH"
To conclude the change, save it and run command below
source ~/.bash_profile
Test if php@5.6 is your current php version used
which php
/usr/local/opt/php@5.6/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.