Problem:
Remote debugger is all set up as is the dbgproxy but dbgproxy keeps trying to contact Komodo directly from the remote server on port 9000 of my local machine… which it can’t do… which is why I am working to set up this proxy in the first place. Details are as follows but the conclusion of my efforts and final questions (for the executive summary) are at the very bottom of this post.
Here is what I have (all actual addresses obscured via example.com, 123.123.123.123, test_key):
- Remote server example.com on Linux platform
- Local Komodo on localhost on Mac OS
- A bunch of functional PHP on my remote server but would like Komodo Debugger to work for the next steps
- A remote internet connection run through an ATT Hotspot (I travel around full time in a trailer)
php.ini contains the following:
zend_extension="/path/to/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=example.com
xdebug.remote_port=9000
xdebug.idekey=test_key
Don’t forget to restart apache so php.ini changes go active.
I have confirmed appropriate setup of xdebug via phpinfo() on the remote server:
xdebug support enabled
Version 2.4.0-komodo
IDE Key test_key
Supported protocols Revision
DBGp - Common DeBuGger Protocol $Revision: 1.145 $
Directive Local Value Master Value
xdebug.auto_trace Off Off
xdebug.cli_color 0 0
xdebug.collect_assignments Off Off
xdebug.collect_includes On On
xdebug.collect_params 0 0
xdebug.collect_return Off Off
xdebug.collect_vars Off Off
xdebug.coverage_enable On On
xdebug.default_enable On On
xdebug.dump.COOKIE no value no value
xdebug.dump.ENV no value no value
xdebug.dump.FILES no value no value
xdebug.dump.GET no value no value
xdebug.dump.POST no value no value
xdebug.dump.REQUEST no value no value
xdebug.dump.SERVER no value no value
xdebug.dump.SESSION no value no value
xdebug.dump_globals On On
xdebug.dump_once On On
xdebug.dump_undefined Off Off
xdebug.extended_info On On
xdebug.file_link_format no value no value
xdebug.force_display_errors Off Off
xdebug.force_error_reporting 0 0
xdebug.halt_level 0 0
xdebug.idekey test_key test_key
xdebug.max_nesting_level 256 256
xdebug.max_stack_frames -1 -1
xdebug.overload_var_dump On On
xdebug.profiler_aggregate Off Off
xdebug.profiler_append Off Off
xdebug.profiler_enable Off Off
xdebug.profiler_enable_trigger Off Off
xdebug.profiler_enable_trigger_value no value no value
xdebug.profiler_output_dir /tmp /tmp
xdebug.profiler_output_name cachegrind.out.%p cachegrind.out.%p
xdebug.remote_addr_header no value no value
xdebug.remote_autostart Off Off
xdebug.remote_connect_back Off Off
xdebug.remote_cookie_expire_time 3600 3600
xdebug.remote_enable On On
xdebug.remote_handler dbgp dbgp
xdebug.remote_host example.com example.com
xdebug.remote_log no value no value
xdebug.remote_mode req req
xdebug.remote_port 9000 9000
xdebug.scream Off Off
xdebug.show_error_trace Off Off
xdebug.show_exception_trace Off Off
xdebug.show_local_vars Off Off
xdebug.show_mem_delta Off Off
xdebug.trace_enable_trigger Off Off
xdebug.trace_enable_trigger_value no value no value
xdebug.trace_format 0 0
xdebug.trace_options 0 0
xdebug.trace_output_dir /tmp /tmp
xdebug.trace_output_name trace.%c trace.%c
xdebug.var_display_max_children 128 128
xdebug.var_display_max_data 512 512
xdebug.var_display_max_depth 3 3
I have confirmed appropriate setup in Komodo at Komodo>Debugger>Connection:
Komodo should listen for debugging connections on:
x a specific port: 9000
I am running a debugger proxy and Komodo should use it:
is checked and set to:
Proxy Listener Address: example.com:9001
Proxy Key: test_key
I can start the proxy on the remote, linux server via:
./pydbgpproxy -i example.com:9001 -d example.com:9000
Which yields the following output:
INFO: dbgp.proxy: starting proxy listeners. appid: 940
INFO: dbgp.proxy: dbgp listener on example.com:9000
INFO: dbgp.proxy: IDE listener on example.com:9001
The remote server IP is:
123.123.123.123
The IP Address that Xdebug is seeing Komodo request from is (apparently as evidenced in the Server:onConnect):
456.456.456.456
And when I start the Komodo debugger listening via Debug>Listen For Debugging Connections, I get:
INFO: dbgp.proxy: Server:onConnect (‘456.456.456.456’, 64471) [proxyinit -p 9000 -k test_key -m 1]
And Debugger>Listener Status Tells me:
Debugger Listening: Yes
Host Address:
Host Port: 9000
Proxy Enabled: Yes
Proxy Key: test_key
Proxy Client Address: example.com
Proxy Client Port: 9000
Current Session: 0
Current Connections: 0
Total Connections: 0
Then when I start the debugger via:
http://example.com/test?XDEBUG_SESSION_START=test_key
I get:
INFO: dbgp.proxy: connection from 123.123.123.123:57335 [<main.sessionProxy instance at 0x1365c20>]
And… Komodo does absolutely nothing, the browser hangs and then times out with the proxy telling me:
ERROR: dbgp.proxy: Unable to connect to the server listener 456.456.456.456:9000 [<main.sessionProxy instance at 0x1365c20>]
Traceback (most recent call last):
File “./pydbgpproxy”, line 220, in startServer
self._server.connect((self._serverAddr[0], self._serverAddr[1]))
File “”, line 1, in connect
error: [Errno 110] Connection timed out
WARNING: dbgp.proxy: Unable to connect to server with key [test_key], stopping request [<main.sessionProxy instance at 0x1365c20>]
INFO: dbgp.proxy: session stopped
And if I try an invalid test key (bubba) I get:
INFO: dbgp.proxy: connection from 123.123.123.123:60471 [<main.sessionProxy instance at 0x111ab90>]
WARNING: dbgp.proxy: No server with key [bubba], stopping request [<main.sessionProxy instance at 0x111ab90>]
INFO: dbgp.proxy: session stopped
My conclusions so far (correct me if I’m wrong) are:
-
Xdebug and the proxy are listening appropriately and accepting incoming request from Komodo and the Browser
-
Instead of going back through the proxy to contact Komodo (Komodo should be listening to the proxy for incoming connections), Xdebug is attempting to contact Komodo on my local computer directly through my ATT Hotspot (which it can’t do and which is why I am working on setting up the proxy in the first place)
My questions are:
-
Why should Komodo be listening for debugging connections on port 9000 of my local system (found at Komodo>Debugger>Connection)? Aren’t we running through a proxy for Komodo to listen on the remote port because the remote server can’t contact Komodo on my local machine?
-
Have I done something wrong in the setup? I’ve followed the set-up directions to the letter and have tried many other solutions from other forums with no luck.
-
Does anyone have input on a fix? It’s likely some stupid oversight on my part.
Thanks in advance… for now, I’ll go back to debugging the old fashioned way… bleh!
Fred