NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Pls help with DBG! Argh!


Joined: 01 Dec 2004
Posts: 2
Reply with quote
Very confused on how to configure this...

I get the error below:

Failed to run DBG session

reason:
connection to the client address 127.0.0.1:7869 is not allowed
debugger request found in "query_string".

I've been through the FAQ's and Help...The debugger is definately enabled according to phpinfo(), and the versions are correct for compatibility, I disabled my firewall, etc...

I did a netstat command at a command prompt and found that my IP address has port 7869 open and not 127.0.0.1. Shouldn't I have the port open for 127.0.0.1, my localhost? This seems wrong to me and I hope someone can clarify. Well anyway, I changed the IP in my php.ini hosts_allow to my IP address and restarted my server just as a test to see if I could get the debugger to work, but it is still reading 127.0.0.1 somewhere (as you can see above), and I'm not sure where it is reading it from.
I would love to get this working and I am open to any help at all, HELP!

Windows XP
Apache 2.0.52
php 4.3.9
phped 3.3.3
View user's profileFind all posts by orionSend private message


Joined: 09 Dec 2003
Posts: 92
Reply with quote
When debugging, the PHP DBG extension (running as part of PHP in your webserver) connects to the DBG Listener which is running at your machine at port 7869.

Obviously, the DBG extension tries to find the listener at 127.0.0.1.

There might be two problems here, which I cannot clearly distinct from your post. Please check both.

1. The listener might not be listening at 127.0.0.1, but is listening on some other address, e. g. the IP address of a local network interface. You can find out by running "netstat -an" at a command prompt.

If so, the problem is that when you're requesting some script from Apache, the debugger will by default connect to "clienthost", that is, the address it sees as the REMOTE_HOST (also available in PHP as a $_SERVER variable). Now if running Apache locally (127.0.0.1), REMOTE_HOST will also be 127.0.0.1, which mismatches if the listener is bound to some other address.

The "real" solution would be to get the debugger listening on "all" local addresses. The "workaround" is to start debugging by requesting the script in a browser and adding the URL parameter "?DBGSESSID=1@[the_address_the_listener_is_listening_at]".

2. Even if 1. is set up correctly, the hosts_allow setting in php.ini might prohibit a connect to the listener address. This is a security feature, as you can download the plain scripts through the debugger. So you can setup dbg only to connect to debug listeners at addresses you "trust".

For your setup, you should make sure that both 127.0.0.1 and your local NIC address are among the "hosts_allow"ed. (Don't forget to restart apache after that, if necessary Wink).

Note that this setting does not tell the Apache-side dbg extension to which address to connect (that is taken from the DBGSESSID request parameter), but only which addresses are allowed at all.

As a sidenote: On *nix systems (which is not the case here) the DBG extension also checks the tcpwrappers /etc/hosts.allow file; this might seem a little strange as this file usually applies to "servers", that is, it is consulted whenever some external machine tries to connect to the local system. In the DBG case, the connection is made from the webserver to the listener, that is, the webserver is the _client_, the listener is the _server_ at that moment. So hosts.allow is used the "other way round" Smile
View user's profileFind all posts by mpSend private message


Joined: 01 Dec 2004
Posts: 2
Reply with quote
Thanks for that...
I'm not sure what happened but I started it back up this morning and read your post and changed the hosts_allow back to 127.0.0.1 and changed the Debugger settings back to localhost from the default clienthost (which I had done all this before) and now it works! Very strange...

Thanks again for your time! Very Happy
View user's profileFind all posts by orionSend private message
Pls help with DBG! Argh!
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