Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mg983's avatar

Can't get Xdebug to work, detailed explanation inside.

I combined the xdebug lesson and the composer lesson to try to get my own development environment going, I used Jeffrey's Vagrantfile and install.sh as a boilerplate and created the following Vagrantfile and install.sh. Note that I am using https://github.com/smdahlen/vagrant-hostmanager to get local host names to map.

Here's the files I am using: https://gist.github.com/matstars/fd7d653d8e5ccb83d848

In PHPStorm I tried adding a new PHP Remote Debug under Run/Debug Configurations I added a server using host: http://mysite.dev port 9000 and Debugger xdebug

I added an IDE key of VAGRANT clicked Apply => OK and then clicked the bug to turn on the debugger. The debugger tab says Waiting for incoming connection with ide keyVAGRANT`

I downloaded xdebug helper (https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=enl) for chrome and set its IDE key to VAGRANT then added about 25 breakpoints at all different points (for this example I am using a wordpress install and added breakpoints in my themes functions.php file and a bunch in the wp-config.php file just to test out xdebug. I turn on xdebug helper, reload the site, and the site loads without any debugging or stops.

Am I doing anything wrong or missing anything? Here is my xdebug section from phpinfo()

http://i.imgur.com/1YzmvOb.png

Thanks!

0 likes
6 replies
mg983's avatar

If anyone runs into this issue in the future, make sure you have settings similar to below in your xdebug.ini

xdebug.cli_color=1
xdebug.show_local_vars=1
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=192.168.0.1
xdebug.remote_port=9000
xdebug.remote_autostart=0
xdebug.ide_key='VAGRANT'

2 likes
gustavocb's avatar

Hi, there I am experiencing the same problem, I am using phpstorm with homestead, my xdebug-ini has very similar configuration but the debugger still waits for incoming connection ... I am using xdebug 2.4 any other option to try? thanks

superern's avatar

@mgargano , his solution works.

I was updating my /etc/php.ini for 4hours. Hoping to have a successful connection between my remote server xdebug and local PHPstorm IDE. Luckily I read his answer. Try to edit xdebug.ini

I suggest, you guys add this one

xdebug.remote_log= "/tmp/xdebug/remote.log"

so you can monitor what's happening on the connection.

Cheers!

Please or to participate in this conversation.