- Go to PHPStorm
Settings > Project settings > PHP > Servers - Add server with following parameters:
- Name:
vagrant(same asserverName=indebugscript) - Host, port: set vagrant box IP and port
- Debugger: Xdebug
- [v] Use path mappings
- Map your project root in host to relative dir in guest
- Hit OK
- Name:
- PHPStorm > Run > Start listen for PHP Debug connections
- Put a breakpoint
- Find where your Xdebug config is stored. Run
$ php -i | grep iniand look for*xdebug.inior*custom.ini- depends on configuration (mine was in/etc/php5/cli/conf.d/zzzz_custom.ini) - Add following
xdebug.remote_host = 11.22.33.1, when box ip is11.22.33.* - Create file
/usr/bin/debugwith contents added below (filedebugbelow) - Make it executable
$ sudo chmod 0777 /usr/bin/debug - Run your script prefixed with
debug:$ debug app/console cache:clear
- Debugger window should open in IDE
you can also
/your/path/to/app/consolecache:clear