Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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