10
votes

My work setup is a Windows XP host, running an Ubuntu VM LAMP stack. I am using PhpStorm to edit my code on my host Windows machine. Upon saving files are automatically uploaded to the VM via SFTP. Everything works for this process, except debugging.

I have setup PhpStorm to have a server named "UbuntuVM" with the following settings:

Debugger:
- XDebug
Debug session settings:
- Break at the first line
- Wait for connection with ide key: XDEBUG_PHPSTORM
Before launch:
- Upload files to selected server

I am using Chrome with Xdebug Helper, and have set the extension to use "Other" as the IDE, with "XDEBUG_PHPSTORM" as the key.

The VM has the following in the php.ini:

zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=10.1.6.22
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.collect_params=On
xdebug.show_local_vars=On

When I set a break point in my IDE, enable the debugger in Chrome, and reload the page, I never hit the break point; and the IDE says "Waiting for connection on port 9000 with ide key 'XDEBUG_PHPSTORM'".

Does anyone have any idea why I'm not hitting my break points?

1
I have written a guideline for exactly this: How to debug code on a remote server (or in vagrant box) with PHPStorm. Vagrant is a technology that sets up servers within virtual machines easily. - Sliq
This is a very old post. I have since moved to Vagrant as well. It's a developer's dream come true. - Andrew Ellis

1 Answers

8
votes

Comes to find out that xdebug.remote_host isn't needed, rather, use xdebug.remote_connect_back=1.