Xcodeをインストール
App Storeから。
Xcodeを一回は起動しておく。
コマンドラインツールをインストール
https://developer.apple.com/downloads/
Mac Ports をインストール
https://www.macports.org/install.php
phpをインストール
sudo port install php56
途中で以下のメッセージが出る
To customize php56, copy /opt/local/etc/php56/php.ini-development (if this is a development server) or
/opt/local/etc/php56/php.ini-production (if this is a production server) to /opt/local/etc/php56/php.ini and then make changes.
他のを入れる
sudo port install php56-postgresql
sudo port install php56-mbstring
sudo port install php56-gd
sudo port install php56-mcrypt
php.ini 編集
sudo cp /opt/local/etc/php56/php.ini-development /opt/local/etc/php56/php.ini
sudo vim /opt/local/etc/php56/php.ini
php.ini
date.timezone = Asia/Tokyo
サーバー起動
/opt/local/bin/php56 -S localhost:8765