NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Persistent problem with debugbreak and SSH tunnel


Joined: 26 Sep 2006
Posts: 20
Reply with quote
Hi all

I'm trying to remote debug through a SSH tunnel.

Setup:
SSH Tunnel up and running on port 10005 (confirmed with "netstat -qa | grep 10005" on server and client)

Running the very latest version of PhpED and dbg.

/etc/php.d/ZZdbg.ini content:
zend_extension=/usr/lib/php/modules/dbg-php-5.2.so

[debugger]
debugger.enabled=on
debugger.profiler_enabled=on
debugger.hosts_allow=localhost
debugger.hosts_deny=ALL
debugger.ports=10000/16
debugger.JIT_enabled=on
debugger.JIT_host=localhost
debugger.JIT_port=10005

Apache restarted - settings look fine with phpinfo()

Output from command: php -v
PHP 5.2.9 (cli) (built: Mar 10 2009 16:42:52)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with DBG v3.8.3, (C) 2000,2009, by Dmitri Dmitrienko

Telnet from the server works. Output in Dbg Listener:
127.0.0.1 client connected

BUT, when execution hits the following statement:
debugbreak('1@localhost:10005');

I get this error in the browser (Firefox 3.5.2):
DBG 3.8.3

Failed to start DBG session

Reason: failed to connect to the client at 127.0.0.1:10005, please make sure that IDE is running
Not sure what it means? Visit http://www.nusphere.com/dbg/ for troubleshooting.

Debugger request: "1@localhost:10005"
Request found in: "DebugBreak(arg)"
Target PHP version: "5.2.x"
Server API: "Apache 2.0 Handler"
Extensions API: "220060519"
Modules API: "20060613"
PHP API: "20041225"


Any ideas what could be the problem?
I'm debugging since a few years now with PhpED & dbg through SSH tunnels and mastered quite some struggles.
But this one is really persistent...

Regards
Marcel
View user's profileFind all posts by nezzoSend private message


Joined: 26 Sep 2006
Posts: 20
Reply with quote
Hi

No ideas? Dmitri?

Regards
Marcel
View user's profileFind all posts by nezzoSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Quote:
confirmed with "netstat -qa | grep 10005" on server and client


Most probably it's wrongly confirmed.
Please check one more time on the server.
If you're not sure, post the output of
$netstat -na | grep -F '10005'

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 26 Sep 2006
Posts: 20
Reply with quote
Hi Dmitri

Another employee (different port) got the same problem with another remote server, now using the latest 5.9 version of PhpED.
The symptoms are the same, the debugger cannot connect...

Output of netstat:

netstat -na | grep -F '10006'
tcp 0 0 127.0.0.1:10006 0.0.0.0:* LISTEN
tcp 0 0 ::1:10006 :::* LISTEN

How does this look to you?

Regards
Marcel
View user's profileFind all posts by nezzoSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Well, seems ssh tunnel listens on the server's TCP 127.0.0.1 / 10006
(you can make sure by checking pid)
Make sure that Debugger Host and DEbugger Port are set to localhost / 10006
then check the client side of the tunnel and make sure that it connects to the dbglistner which is supposed to listen on 10006 port too.
you can check dbglistener with almost the same command:
netstat -naop TCP
and find the line with :10006 and LISTEN words.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 26 Sep 2006
Posts: 20
Reply with quote
hi dmitri

thanks for your tips!
meanwhile we found the solution to our remote debugging problem.
it had noting to do with the SSH tunnel. we just need to change SELinux from "enforcing" to "permissive" while debugging.
we found out after disabling all the other ususal suspects in regards of security: suhosin and mod_security.
didn't test it so far, but i think suhosin and mod_security are working fine with dbg.

of course one needs to disable eAccelerator too (or APC, ionCube PHP Accelerator, XCache, Zend Optimizer etc.).
this we knew from the beginning. i'm just mentioning it for people using the forum search engine...

regards
marcel
View user's profileFind all posts by nezzoSend private message
Persistent problem with debugbreak and SSH tunnel
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