8

How do you setup a multi-developer XDebug PHP environment?

I have the following setup:

  • I have a linux machine with Apache and Xdebug loaded and a php.ini file that I think is correct.
  • I found a python proxy script that I'm using to proxy the calls from the PDT Eclipse IDE's my developers are using to the Apache/Xdebug running on the same web server.
  • I set the idekey in php.ini to "ECLIPSE_DBGP" and for Xdebug to autostart

From the log information from the proxy it says that there is no server with the key "ECLIPSE_DBGP" and it stops the request.

Has anybody run into this or has a step by step setup to get this to work?

I have exhausted what I have found using google.

1 Answer 1

19

You can use ssh to tunnel the debug-connection back to your client machine. Eg. from your client machine, connect to the server with something like:

ssh -R 9000:localhost:9000 [email protected]

Then fire up your (local) debugger, and start the remote script. Xdebug (at the server) will now establish a connection to its localhost:9000, but since this port is forwarded back to your local machine, your (local) debugger will receive the connection.

If you use Windows on your client side, you can do the same thing with PuTTY.

See the documentation for Spectator for some more details.

Sign up to request clarification or add additional context in comments.

6 Comments

not actually addressing the question, but what I was looking for nonetheless. Spectator still works, after 2 years of bitrot :)
@eric Yeah, there are some minor bugs and things that could be nicer about spectator, but I haven't had the time to do anything about them.
If we are remote debugging, would the xdebug.remotehost line in the php.ini be set to localhost? stackoverflow.com/questions/9818202/…
@cymbals - Yes, the ssh command routes the (remote) localhost back to your debugger client. So from Xdebug's perspective, it talks to localhost.
@troelskn - Thanks! Would this would be limited to one person debugging at a time, since everyone would be using the same port?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.