I'm using Laravel Homestead, I created a couple of aliases for turning on/off Xdebug quickly, and I use them before/after heavy composer commands, something like this:
$ xdebug_off # Disable Xdebug
...
$ composer heavy-load stuff
...
$ xdebug_on # Enable Xdebug
...
Once you are inside your box (after vagrant ssh
), add these aliases to you ~/.profile
file:
# Xdebug aliases
alias xdebug_on='sudo phpenmod xdebug; sudo service php7.0-fpm restart;'
alias xdebug_off='sudo phpdismod xdebug; sudo service php7.0-fpm restart;'
If you do this a lot, you can use my shortcut, fire this command on your virtual machine:
curl -LsS https://git.io/vrc3y >> ~/.profile; source ~/.profile