Skip to content

Instantly share code, notes, and snippets.

@shadowhand
Created October 12, 2016 14:46
Show Gist options
  • Save shadowhand/5166013c556a162bed1d8e3022d99a2f to your computer and use it in GitHub Desktop.
Save shadowhand/5166013c556a162bed1d8e3022d99a2f to your computer and use it in GitHub Desktop.
Shell alias for enabling xdebug when running phpunit
# This assumes you have installed php56 and php56-xdebug, and installed phpunit
# globally. Replace php56 with php71 or whatever version you use. For example:
#
# brew install php56 php56-xdebug
# composer global require phpunit/phpunit
#
# After installing xdebug, you will need to disable xdebug from always loading:
#
# $EDITOR /usr/local/etc/php/5.6/conf.d/ext-xdebug.ini
#
# Comment out the "zend_extension" line and save it.
#
# Now install this alias and enjoy.
alias phpunit="php -dzend_extension=$(brew --prefix homebrew/php/php56-xdebug)/xdebug.so $(which phpunit)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment