- Go to PHPStorm
Settings > Project settings > PHP > Servers
- Add server with following parameters:
- Name:
vagrant
(same asserverName=
indebug
script) - 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 ini
and look for*xdebug.ini
or*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/debug
with contents added below (filedebug
below) - 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