Skip to content

Instantly share code, notes, and snippets.

@valentinemayaki
Forked from aminemat/xdebug-cli.snippet
Created May 24, 2019 06:32
Show Gist options
  • Select an option

  • Save valentinemayaki/89aa9acefd85fcd3fd8cadcafa82f036 to your computer and use it in GitHub Desktop.

Select an option

Save valentinemayaki/89aa9acefd85fcd3fd8cadcafa82f036 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