Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Configure

xdebug.ini

xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
xdebug.idekey=vagrant     
xdebug.remote_host=10.0.2.2

The remote_host is the IDE's host ip from the vagrant box. 10.0.2.2 seems to be the default...i think, works for me.

In PHPStorm

Setup Server

Add Debug Configuration

Run > Edit Configurations...

Start Debugging

Run > Debug...

Set a breakpoint

Run your command, then switch to PHPStorm

Profit!

@aczietlow
Copy link

aczietlow commented Feb 12, 2015

First off ++ for taking the time to document this.

According to the xdebug documentation http://xdebug.org/docs/all_settings

When xdebug.remote_connect_back is enabled xdebug.remote_host is ignored. remote_connect_back attempts to connect back to the ipaddress of any http request.

** Please note that there is no filter available, and anybody who can connect to the webserver will then be able to start a debugging session, even if their address does not match xdebug.remote_host. **

Once more, thanks for taking the time to write this in a gist and know that you are an awesome human being.

@k-zakhariy
Copy link

k-zakhariy commented Oct 31, 2018

This works fine for me:

xdebug.max_nesting_level=300
xdebug.remote_enable=1
xdebug.remote_connect_back=0
xdebug.remote_port=9000
xdebug.scream=0
xdebug.cli_color=1
xdebug.remote_host=10.0.2.2
xdebug.remote_autostart=1
xdebug.show_local_vars=1
xdebug.idekey=PHPSTORM
xdebug.remote_log=/tmp/xdebug.log
xdebug.remote_handler=dbgp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment