brew install php71 --without-apache --with-fpm
brew install php71-opcache
brew install php71-mcrypt
brew install php71-xdebug
$(brew --prefix gettext)/bin/envsubst < ~/ts_environment/config/php-ts.ini > $(brew --prefix)/etc/php/php71/conf.d/php-ts.ini
brew services start php70
PHP Configuration file including xdebug is here: https://github.com/thinkshout/ts_environment/blob/master/config/php-ts.ini