Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@aminemat
Last active May 24, 2019 06:32
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save aminemat/1492d3d81096c54547c9 to your computer and use it in GitHub Desktop.
Save aminemat/1492d3d81096c54547c9 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