Skip to content

Instantly share code, notes, and snippets.

@zahardev
Last active May 29, 2018 12:48
Show Gist options
  • Save zahardev/d994e12a4ca22b1f7eadff4a659d76ed to your computer and use it in GitHub Desktop.
Save zahardev/d994e12a4ca22b1f7eadff4a659d76ed to your computer and use it in GitHub Desktop.
Debug CLI PHP on the Vagrant server
  1. Create file phpdebug
  2. chmod +x phpdebug
  3. mv phpdebug /usr/bin/phpdebug
  4. Using: phpdebug vagrant test.php phpdebug yourServerName test.php
#!/bin/bash
export PHP_IDE_CONFIG="serverName=$1"
export XDEBUG_CONFIG="idekey=PHPSTORM remote_enable=1 remote_mode=req remote_port=9000 remote_host=10.0.2.2"
php $2 $3 $4 $5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment