Skip to content

Instantly share code, notes, and snippets.

@jpcaparas
Created October 12, 2017 23:23
Show Gist options
  • Save jpcaparas/d8249ac287f40162b333f85cd5831f44 to your computer and use it in GitHub Desktop.
Save jpcaparas/d8249ac287f40162b333f85cd5831f44 to your computer and use it in GitHub Desktop.
PHP Storm Xdebug client connect on Vagrant-installed PHP
#!/bin/sh
# - `chmod 777 debug.sh` to make it executable
# - Put this file on your `/usr/bin` dir so you can call it anywhere
# - Rename it to `debug`
# - Change variables as needed
# Usage: debug php artisan
PHP_IDE_CONFIG="serverName=vagrant" \
XDEBUG_CONFIG="idekey=XDEBUG" \
XDEBUG_EXT_PATH="/usr/lib/php/20160303/xdebug.so" \
XDEBUG_PORT="9000"
VAGRANT_IP="10.0.2.2"
$(which php) \
-dzend_extension=$XDEBUG_EXT_PATH \
-dxdebug.remote_enable=1 \
-dxdebug.remote_port=$XDEBUG_PORT \
-dxdebug.remote_autostart=1 \
-dxdebug.remote_host=$VAGRANT_IP \
${@}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment