Last active
May 24, 2019 06:32
-
-
Save aminemat/1492d3d81096c54547c9 to your computer and use it in GitHub Desktop.
enable xdebug in php-cli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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