Do PHP source files need to exist locally AND remotely when using XDebug remote debugging in eclipse?

0

Issue

I’m really confused about XDebug remote debugging using Eclipse.

I use Windows (with eclipse and all that jazz) to do my development, but I would like to test my code in the same environment as my production environment.

I have been tinkering with XDebug remote debugging to support this. I have correctly configured XDebug on the remote machine and made sure the ports were open. But what’s really puzzling me is – do the source files on my machine need to also exist on the remote server running PHP and XDebug? Right now I do not have any PHP executables on my local development machine so there’s no possible way the scripts can be run on it.

Thanks

Solution

Yes, the identical set of files needs to exist on the server and client.

The files on the server are the ones that actually get run during your debugging session.

The files on the client are what Eclipse will show you when the debugger halts at a breakpoint. The server will tell Eclipse that it stopped at line X of file Y, and Eclipse will show you line X of file Y from the local file set. So if the local file is different from the remote file, you’ll be debugging the wrong thing and it will be chaos.

Note that it doesn’t matter if you can’t run PHP on the client. The client files aren’t being executed, just displayed in the debugging session.

If you make any edits to the local files, you’ll need to resynchronize them with the server. There are several methods for doing that, some built into Eclipse, in the RSE plugin for example. I prefer to use Unison, or a version control commit back to the server.

Answered By – Andrew Schulman

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More