Install PHP 7.1 + Xdebug on OSX

I don't think 7.2 xdebug is available in Homebrew yet, so I had to go with 7.1

  1. Install xcode
  2. Install Homebrew
  3. Add Homebrew PHP
    1. brew tap homebrew/homebrew-php

  4. Install Xdebug

    1. brew install homebrew/php/php71-xdebug

  5. Add to .bashrc: export PATH="$(brew --prefix homebrew/php/php71)/bin:$PATH"

    1. source ~/.bashrc

  6. Check w/ php -i | grep xdebug

    1. If you get an error about readline: ln -s /usr/local/Cellar/readline/7.0.3_1/lib/libreadline.7.dylib /usr/local/opt/readline/lib/

Tags
xdebug