Remote php debugging not working

Hi,

I cannot make my remote xdebug working.

My php runs on virtual machine 192.168.56.101

And my komodo is on 192.168.1.106

My test.php page, with phpinfo(), shows that xdebug is enabled, with these options :

xdebug.default_enable=1
xdebug.remote_autostart=1
xdebug.remote_connect_back=0
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_host=192.168.1.106
xdebug.remote_mode=req

In my komodo (192.168.1.106), I listen to debugging connections on specific port 9000.

But, going to “test.php?XDEBUG_SESSION_START=1”, on 192.168.1.106, komodo do not stop on the breakpoints.

I do see the lower pane showing up, with the “Debug Output” tab. It just don’t stop on the breakpoints.

What am I missing ?

… oh!! I changed the “initial break behavior” to “break on first executable line”.

Now, it opens the remote file and breaks on the first executable line. I can then add breakpoints in the remote file.

Before it opens the file, I get this : "The URI ‘file://///192.168.1.106/home/vagrant/sites/test/index.php’ could not be opened. You can use a URI mapping to specify an alternative file location. Without a mapping, komodo will display a read-only copy of the file contents. Would you like to setup a mapping now ? "

Why “file:////…” ?

It is synced folders, so is it possible to break on the local copy ? Instead of opening a new copy of the file ?

Remote file is : /home/vagrant/sites/test/index.php
Local file : D:\htdocs\phpacademy\laravelhomestead\sites\test\index.php

Hi, @careyh is more familiar with PHP debugging than I am, but it sounds like you do not have URI mapping set up properly (Edit > Preferences > Mapped URIs). Try setting them up and Komodo should stop opening read-only versions of files, but open your local copies.

But I’m not using ftp.

The folders are synced. There’s no ftp.

How can I set up ftp on synced folders ?

file:///// is not FTP. It’s just an internal URI that Mozilla (and other programs I believe) use to have universal paths. Just setup the mapped URI that Komodo prompts you to set up and you should be fine.

  • Carey

But do I have to install an ftp server on the remote VM ?

Do you not have a local version of the file? Is the file only on the VM?

What do you mean by this? What is synced where?

If you’re going to use FTP then yes you would need an FTP server. It’s up to you how you make your files accessible. I don’t understand your workflow or use case so I can’t really advice you on what you should do.

  • Carey

By synced I mean :

The VM is a vagrant machine.

I start the machine with vagrant up.

Then, the files in /var/www are synced with my local directory where the vagrant file resides.

So, it’s already syncing. I don’t need to set up an ftp for synchronisation.

Do you think I can setup an ftp server on top of that ?

If it’s already synced to a local directory then why bother with FTP? Just select the local path. Click the “Local” button rather than the “Remote” button in the dialog.

  • Carey

Awesome! It works.
Thank you Carey.

I’m also confused about “debugger proxy”, if you have a chance to look : Debugger proxy, how?

Thanks,

Patrick

Oh right, thanks for the reminder. I was looking at that then got distracted.