Install Homebrew

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

Install Ruby (new version)

brew install ruby  

Install MySQL

brew install mysql  
mysql_secure_installation  

Create config file at /etc/my.cnf, tell MySQL only listen to localhost.

[mysqld] 
bind-address = 127.0.0.1  

Run on boot

mkdir -p ~/Library/LaunchAgents  
cp `brew --prefix mysql`/*mysql*.plist ~/Library/LaunchAgents/  
launchctl load -w ~/Library/LaunchAgents/*mysql*.plist  

Install Redis

brew install redis  

Run on boot

ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents  

Install Apache/PHP

Modify apache config file /etc/apache2/httpd.conf, change Listen 80 to Listen localhost:80. Uncomment LoadModule php5_module libexec/apache2/libphp5.so to turn on PHP.

Start Apache

sudo apachectl start  

Install phpMyAdmin

Donwload phpMyAdmin and put in /Library/WebServer/Documents
Run http://localhost/setup in browser, to generate basic config file for phpMyAdmin.
Host value change from localhost to 127.0.0.1
Remove setup directory when complete.
Add $cfg['LoginCookieValidity'] = 999999999; in phpMyAdmin config file, so it won't timeout.