How to install XDebug with PHP 5.6 on MacOS 10.12

Mostly writing this up for my own reference (because I’ll undoubtedly have to do this again at some point), but hope it might be helpful to others out there.

First, install HomeBrew:

/usr/bin/ruby -e "$(curl -fsSL"

Use HomeBrew to install autoconf and XDebug:

brew tap homebrew/homebrew-php
brew install autoconf
brew install php56-xdebug

Optionally, install xdebug-osx to enable toggling of XDebug:

brew install xdebug-osx

Next, update your php.ini file with these lines:

xdebug.profiler_output_dir="<AMP home\tmp>"

You should be good to go now. You can confirm by checking your config with the XDebug Config Checker.


Written on July 3, 2017