Skip to content

Instantly share code, notes, and snippets.

@Albus
Forked from aminemat/xdebug-cli.snippet
Created July 22, 2017 22:31
Show Gist options
  • Save Albus/e803ff1dd3ed427f00032febcc786f7d to your computer and use it in GitHub Desktop.
Save Albus/e803ff1dd3ed427f00032febcc786f7d to your computer and use it in GitHub Desktop.
enable xdebug in php-cli
export XDEBUG_CONFIG="idekey=PHPSTORM"
export PHP_IDE_CONFIG="serverName=cli"
;in php.ini
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=HOST_IP
xdebug.remote_port=9000
; aliases
alias startx='export XDEBUG_CONFIG="remote_host=IP"'
alias stopx='unset XDEBUG_CONFIG'
OR
=============
alias php-debug-vagrant=phpdebugvagrant
function phpdebugvagrant {
export PHP_IDE_CONFIG='serverName=cli'
CONNECTBACK=`echo $SSH_CLIENT | awk '{print $1}'`
export XDEBUG_CONFIG="idekey=PHPSTORM remote_host=$CONNECTBACK remote_port=9000"
"$@"
unset XDEBUG_CONFIG
unset PHP_IDE_CONFIG
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment