Xdebug not working


To take the maximum out of the debugging process I use the xdebug instead of using var_dump() and print_r.
But the problem is that with trellis I don’t get the debugging to work here.


xdebug_install: true
php_xdebug_remote_enable: true
php_xdebug_remote_connect_back: true
php_xdebug_remote_host: localhost
php_xdebug_remote_port: 9000
php_xdebug_remote_log: /tmp/xdebug.log
php_xdebug_idekey: XDEBUG
php_max_nesting_level: 200

But when I SSH into the vagrant box and look in the /tmp/xdebug.log i see the following:

Log opened at --------------
I: Checking remote connect back address.
I: Checking header ‘HTTP_X_FORWARDED_FOR’.
I: Remote address found, connecting to,
E: Could not connect to client. :frowning:
Log closed at --------------

Maybe it is good to mention I use PHPStorm as my IDE.

Anyone knows what the problem could be? (tried on two machines)

Thanks in advance.

Hi, did you start the debugger in PHPStorm?

I have a similar problem: xDebug is working - but only if I set a breakpoint in “site/web/index.php”. Then I can step through some wordpress classes. But if I set a breakpoint in a php file in my theme, then xDebug doesn’t stop.
I’ve tried to set up some path mapping but without success.
I think it’s a problem with the mapping…

Any ideas?