Setting up Remote debugging with Xdebug

Hi,

I’ve set up Xdebug to debug remotely as my set up consists of windows 10 + Linux VM, but can’t seem to get it to work in Komodo. It seems like I am missing something. I’ve spent many hours reading docs and forum posts. Here are my settings:

  • Komodo & Browser is insatlled on my Windows 10 PC.
  • I use a Virtual Machine for my LAMP setup, and Komodo connects to my VM remotely to edit files.
  • Xdebug is installed on my VM and it is running
  • I am using the Xdebug Helper Chrome extension

Komodo Settings:

  • I am running a debugger proxy and Komodo should use it is checked.
  • Proxy listener address: 127.0.0.1:8888 - (Windows Proxy Address)
  • Proxy Key: komodo

php.ini settings (hosted on the Linux VM):

xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.remote_host = “192.168.117.18” (Windows IP)
xdebug.remote_port = 9002
xdebug.idekey = “komodo”

Komodo listener status results:
Debugger Listening: Yes
Host Address: - {Empty}
Host Port: 8888
Proxy Enabled: Yes
Proxy Key: komodo
Proxy Client Address: - {Empty}
Proxy Client Port: 0
Current Sessions: 0
Current Connections: 0
Total Connections: 1

Now, I start a debug session in the browser with the xdebug helper extension, I add a break point to a PHP file, reload the page and nothing breaks and no debug results in komodo.

Have I done anything wrong or am I missing anything?

Thank You.
Rick,

Going just by your settings there, Komodo is listening on port 8888 but you are configuring xdebug to connect on port 9002. These ports must match.

That is a very good point, can’t believe I missed that! I must have forgotten to update it after changing ports. I’ve updated now, still nothing but I’ll restart everything and keep trying.

Make sure you restart your web server also. If that doesn’t work; have you verified that your web server is using the right php.ini? You should verify by checking the phpinfo() output.

I can confirm this is still not working for me after restarting host machine & web server, and definitely using the correct php.ini file. I might try set the dbgp on a different port again or maybe set up the dbg proxy on the remote machine instead.

Thanks.

Something to try as well is to not use the browser extension. All you need to do is append the ?XDEBUG_SESSION_START=komodo query to your url.

Great, I will use that until I get it working, it helps filter out where the problem may be. Thanks. I will reply with the solution if/when I find it!

It seems as my ports reset after restarting windows, so I’ve used the python dbgp proxy application pydbgpproxy.exe and it shows this info:

dbgp listener on 127.0.0.1:9000
IDE listener on 127.0.0.1:9001

I’ve set Komodo Proxy listener address to 127.0.0.1:9001, and the listener status shows:

Debugger Listening: Yes
Host Port: 9000
Proxy Client Port: 9001

Do I set xdebug.remote_port in php.ini to 9000 or 9001?

(I’ve tried both, nothing yet but I feel I am a step closer now)

Perhaps that is your issue; why are you using a proxy at all? Given that you say you are running the server on a VM it does not seem like you need a proxy and you are only needlessly complicating the setup.

I was hoping not to use a proxy, and I have tried without a proxy, with a windows proxy and with a linux proxy.

If I go without a proxy, I uncheck komodo remote debugger setting and set to port 8888, listener status is successful and I have these settings in php.ini:

xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp (Tried with and without this)
xdebug.remote_mode = req
xdebug.remote_host = “192.168.112.43” (Host machine IP)
xdebug.remote_port = 8888
xdebug.idekey = “komodo”

These settings do not work. I am very close to getting this working using the linux proxy. Hopefully I can post my solution here soon! Thanks :smile:

You need to remote the remote_autostart, as per our documentation: http://docs.komodoide.com/Manual/debugphp#php_remote_autostart_warning

Also, did you download the remote debugging bits from our website?

http://code.activestate.com/komodo/remotedebugging/

Does phpinfo() show that xdebug is loaded?

Ok, I turned off the autostart (I had it off before). I noticed that the PHP debugging bits (dll file) are already in the komodo IDE installation files, so I didn’t download them, but I did download the Python Remote debugging client (Windows & Linux). Xdebug does show up in the php_info() page.

If I execute this command on linux in the python debugger:

./pydbgpproxy -d 127.0.0.1:9001 -i 192.168.56.102:9002

Komodo is listening successfully and returns this:

INFO: dbgp.proxy: starting proxy listeners. appid: 9825
INFO: dbgp.proxy: dbgp listener on 127.0.0.1:9001
INFO: dbgp.proxy: IDE listener on 192.168.56.102:9002
INFO: dbgp.proxy: Server:onConnect (‘192.168.56.101’, 54299) [proxystop -k komodo]
INFO: dbgp.proxy: Server:onConnect (‘192.168.56.101’, 54301) [proxyinit -p 9002 -k komodo -m 1]

Now this is as close I got but there is 1 problem, this Server:onConnect IP (192.168.56.101) is not the current IP of my VM, it should be 192.168.56.102, so I don’t know where it’s getting 101 from, as that is an old eth setting in the VM. I’m hoping everything would work if it finds the 102 IP.

I would verify your IP setup, sounds like there may be some mixup there.

Again though, there is zero reason to use the proxy. You’re just making things more complicated that way.

I got this working on my home set up without the proxy. I am pretty sure I had these exact same settings on my work setup anyway, so I think the problem had something to do with the connection from the VM to the PC.

Here are my final settings incase it may be useful in future:

php.ini settings (hosted on linux VM) :

xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.remote_host = 192.168.0.5 (Windows IP Address)
xdebug.remote_port = 9001
xdebug.idekey = komodo

I set the Komodo debugging connection to port 9001, and the debugger proxy setting is unchecked.

Thanks for all suggestions above!