NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
setting up debugging...


Joined: 21 Apr 2005
Posts: 9
Reply with quote
I've got phped evaluation system set up on my SUSE 9.1 linux system. I've also got a remote webserver running apache and the dbg extension.

The problem is getting them to talk together...

If I understand the problem, phped connects to the debugger on the webserver, but the debugger on the webserver also has to be able to talk to something called dbglistener on my client machine. That seems to be running (I ran the test in the docs) but the connection is failling.

I'm guessing that is because my client machine is behind a router and that I have to do some port forwarding to my client machine to allow dbg on the remote web server to connect back to dbglistener on port 7869,

Am I on the right track here? Or totally confused? Smile

TIA: John
View user's profileFind all posts by jalmbergSend private message
Plodding along...


Joined: 21 Apr 2005
Posts: 9
Reply with quote
Okay... I've decided to use the SSH method to connect, but running into a snag...

BTW, I'm really motivated to get this working. I don't really need phped... My fingers know vi very well, but I need a debugger. On my very first programming job, back in 1984, I was writing firmware in assembly language. Even back then we had a breakpoint debugger. I'm fed up trying to write php without a decent debugger. So if I can get this to work, I definitely will buy it!

Where I'm at:

- dbg 2.16.14 is definitely running on the remote webserver. phpinfo() has dbg section that looks good to me. I've followed the SSH instructions and believe it's configured correctly to connect via SSH.

[debugger]
debugger.enabled=True
debugger.profiler_enabled=True
debugger.hosts_allow=localhost ; 24.47.21.53
debugger.hosts_deny=ALL
debugger.ports=7869, 10000/16

- phped is running on my linux client box (behind a router). I've followed the SSH instructions and believe it is configured correctly to connect via SSH

- I opened an ssh connection from my client machine to the server using a line like (actual login changed to protect the innocent.):

ssh -R 7869:localhost:7869 user@domain.com

This connects fine.

However, when I try to run the debugger in phped, I get a pop up window that says "Failed to run debugging session", along with a rather unhelpful tip.

This sent me to the trouble shooting section...

- running netstat on the server gives:

[root@secure root]# netstat -na|grep 7869
tcp 0 0 127.0.0.1:7869 0.0.0.0:* LISTEN

which looks okay.

- but when I try to connect back to dbglistner, this is what I get:

[root@secure root]# telnet localhost 7869
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.

- same thing if I try to connect back through the SSH tunnel connection:

bash-2.05$ telnet localhost 7869
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.

So, now I'm stuck. Any ideas, much appreciated.

Brgds: John
View user's profileFind all posts by jalmbergSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Instead of Windows version, Linux one has no separated listening daemon and runs listening socket for 10-15 sec after you click Run In Debugger, depending on the timeout. If nothing comes during this timeframe it shows ~ failed to run debugger, timed out.

For troubleshoting, I'd recommend a) check debugger module on the server (just run browser on your linux box and check phpinfo() output). b) project settings should have correct root URL that points to the server. c) check if phped runs browser when you click Run In Debugger and browsing URL is correct and contains DBGSESSID variable. d) I'd recommend you to have 7869 as debugger port (see tools->settings->debugger tab).
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 21 Apr 2005
Posts: 9
Reply with quote
Thanks for the reply...

Now I'm not sure how much of the documentation applies to Linux clients.

>>>For troubleshoting, I'd recommend a) check debugger module on the server (just run browser on your linux box and check phpinfo() output).

Yes, this looks good. I've changed php.ini back to what it was before. It's now:

[debugger]
debugger.enabled=True
debugger.profiler_enabled=True
debugger.hosts_allow=localhost 24.47.21.53
debugger.hosts_deny=ALL
debugger.ports=7869, 10000/16

b) project settings should have correct root URL that points to the server.

The root URL is correct... it is the URL of the test website I'm working on.

c) check if phped runs browser when you click Run In Debugger and browsing URL is correct and contains DBGSESSID variable.

It connects to the web server and the correct page, but I get the following result:

DBG
Failed to run DBG session
reason:
failed to connect to the client address 24.47.21.53:7869
debugger request found in "query_string".

Which is why I believe I need to do something with my router to allow this connection to take place. This is what I was trying to avoid by looking at the SSH option, but now I don't know if that will work with a linux client.

d) I'd recommend you to have 7869 as debugger port (see tools->settings->debugger tab).

At this point, I have both auto select port and autoselect host checked.

-- John
View user's profileFind all posts by jalmbergSend private message
Success, I think...


Joined: 21 Apr 2005
Posts: 9
Reply with quote
I added port forwarding for both ports 7869 and 10000 and that seemed to solve my problem.

I still get the pop up window telling me it couldn't start the debug session, but the browser comes up and phped hits a break point. I can step through and when the script completes, the browser seems to actually display the correct info.

I'd really like to know how this works... is the server response to the HTTP request delayed until the script completes??? Really interesting.

Anyway, I'm going to put this baby through its paces this weekend.

-- John
View user's profileFind all posts by jalmbergSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
You may want to increase debug startup TIMEOUT. See tools->settings->debugger tab->"Session wait timeout".
View user's profileFind all posts by dmitriSend private messageVisit poster's website
setting up debugging...
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic