NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Using clienthost within DBGSESSID


Joined: 14 Aug 2006
Posts: 3
Reply with quote
This is more a confirmation than anything and I'm sure this has been answered but I'm unable to find it after days of searching.

What I'm trying to find out is if when passing a page to the debugger with ?DBGSESSID=2@clienthost:7869
tacked onto a URL, the important part being the clienthost:7869 should the debugger automatically determine the remote PC's IP and replace it ? Or is it up to the program being used (vs.php) or user of the program to change the clienthost string into the relevant IP address/hostname thats needed.

I've tried various methods to get this to work, both with vs.php and also separately with clients but can't seem to escape the fact I need to manually change the wording "clienthost" into my IP address each time, once the browser is open for debugging. From my understanding and from what I've read this changing of clienthost to the clients actual IP address should happen on the DBG side of this, I may have interrepted what i've read incorrectly though.

This question is more to determine the dbg modules proper action than help with vs.php, once that worked out I'll go to vs.php people if further help is needed.

As can be seen elsewhere I continuously get the :-
DBG
Failed to start debug session

reason:
failed to establish connection to client host on localhost:7869

Once I change the ?DBGSESSID=2@clienthost:7869 to ?DBGSESSID=2@<My IP Address>:7869 it works flawlessly.

If it is the case that the clienthost should convert to the remote users IP then is there anything that can prevent this from happening in setting, machine configuration, apache, php.ini, version of php used, or selinux being enabeld etc etc

Im using Fedora 3, php 5.1.4 and dbg 2.13.1 compiled from source, the php.ini and dbg settings as extracted from the phpinfo follow.

(php.ini)
[debugger]
extension=dbg.so
debugger.enabled = on
debugger.JIT_host=clienthost
debugger.JIT_port = 7869
debugger.profiler_enabled = on

(phpinfo output)
dbg
DBG php debugger, version 2.13.1, Copyright 2001, 2006, Dmitri Dmitrienko, www.nusphere.com

Version 2.13.1
Linked as a shared library.
Profiler compiled, enabled

Directive Local Value Master Value
debugger.enable_session_cookie On On
debugger.enabled On On
debugger.fail_silently On On
debugger.ignore_nops Off Off
debugger.JIT_enabled Off Off
debugger.JIT_host clienthost clienthost
debugger.JIT_level 3 3
debugger.JIT_port 7869 7869
debugger.profiler_enabled On On
debugger.session_nocache On On
debugger.timeout_seconds 300 300

Thanks in advance for your help.
View user's profileFind all posts by mvandersSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8335
Reply with quote
Quote:
failed to establish connection to client host on localhost:7869

Probably you messed clienthost with localhost. Latter one is a name that is resoved to 127.0.0.1, see hosts file. First one is a keyword recognized by DBG and only. If Debugger sees this name, it looks into $_SERVER[REMOTE_ADDR] and uses it.

Quote:
Once I change the ?DBGSESSID=2@clienthost:7869 to ?DBGSESSID=2@<My IP Address>:7869 it works flawlessly

congratulations.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 14 Aug 2006
Posts: 3
Reply with quote
Thanks for your reply, however, my hosts file is correct and there is no reference to clienthost anywhere in there.

127.0.0.1 localhost

I also tried nslookup to ensure that clienthost wasn't resolving to something it shouldn't through the dns system.

I did do a test however and changed my hosts file to have my IP address as 'localhost' instead of 127.0.0.1 and the system worked fine and did exactly what it is supposed to.

ie. 10.25.101.105 locahost

I also tried placing my IP directly into the JIT_Host setting ie. debugger.JIT_host = 10.25.101.105 still no joy, hence my question on weather something else on the machine would be preventing the dbg module from determining my IP Address.

Obviously the <my IP> localhost in the host file is not an option as there will be a couple of people developing fom this directory.

I'll try putting dbg on another server to test if it does same thing there.

If possible could you PM the line of code in the dbg.c or dbg_net.c that grabs the client_ip and I'll change the source so it ONLY uses the remote IP as this is all we need in this case anyway

Thanks again

Thanks
View user's profileFind all posts by mvandersSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8335
Reply with quote
Quote:
Thanks for your reply, however, my hosts file is correct and there is no reference to clienthost anywhere in there.

127.0.0.1 localhost


Sorry if I didn't make it clear before. Your system does not know clienthost name. It's DBG knows it.

Quote:
I also tried nslookup to ensure that clienthost wasn't resolving to something it shouldn't through the dns system

It's not necessary b'ze DBG does not try to resolve it through any service, including dns. It resolves this namy itself. And takes $_SERVER['REMOTE_ADDR'] for the target address as I told before.

So, leave it alone and let clienthost be there. It should not cause any problems.
Only make sure that DbgListener listnens on the address that comes in the $_SERVER['REMOTE_ADDR'], otherwise it will be the reason for the connection between DBG and DbgListener to fail.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 14 Aug 2006
Posts: 3
Reply with quote
The problem must reside with the vs.php plugin for visual studio.

After installing Expert Debugger, i found it to work as it should.

My appoliges, the vs.php must be setting the incorrect listen address as when i look in the dlglistener settings it defaults to 0.0.0.0, and not my proper ip. At this stage I'm putting this down to an inactive VPN on my machine ( needed for working from home ) as I can't work out how any ip with adaptor with ip 0.0.0.0 would be ending up on my machine.

Sorry to doubt DBG, but days of frustration

Looking forward to be able to debug now !!
View user's profileFind all posts by mvandersSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8335
Reply with quote
Why don't you try NuSphere PhpED with DBG 3.1.6? Smile
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Using clienthost within DBGSESSID
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