Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Remote php debugging with xdebug
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
hnaparst
Apprentice
Apprentice


Joined: 27 Jul 2005
Posts: 215
Location: Hertfordshire, UK

PostPosted: Sun Aug 25, 2013 9:21 pm    Post subject: Remote php debugging with xdebug Reply with quote

I am trying to remotely debug the php on my Gentoo server from my PC using xdebug.

I am able to connect to xdebug from a links browser session on the remote server. However, links is nearly useless, and I would like to trigger xdebug from a graphical browser like Firefox or Chrome on my PC. In theory, this should be easy. You just request

Code:
http://cheap-domains-r-us.com/buggy.php?XDEBUG_SESSION_START=my-php-54


the same as I did in the links session on the remote server (where it worked, did I mention that?)

The problem is that making the same call from my PC's browser doesn't work. I have totally disabled my Windows Firewall and forwarded ports 9000-9001 to my PC at the router. However, xdebug is setting a cookie in my browser, so that is a positive.

xdebug.log:
Code:
Log opened at 2013-08-25 21:00:28
I: Checking remote connect back address.
I: Remote address found, connecting to xx.zzz.xx.yyy:9000.
E: Could not connect to client. :-(
Log closed at 2013-08-25 21:00:31



nc -v xxx.yy.zzz.aa 9000

Code:
homepc.verizon.com [xx.yyy.zz.aaa] 9000 (?) : No route to host



netstat -aon | grep 9000
Code:
tcp        0      0 0.0.0.0:9000            0.0.0.0:*               LISTEN      off (0.00/0/0)



php.ini
Quote:
zend_extension=/usr/lib64/php5.4/lib/extensions/no-debug-non-zts-20100525/xdebug.so
xdebug.auto_trace="0"
xdebug.trace_output_dir="/tmp"
xdebug.trace_output_name="trace.%c"
xdebug.trace_format="0"
xdebug.trace_options="0"
xdebug.collect_includes="1"
xdebug.collect_params="0"
xdebug.collect_return="0"
xdebug.collect_vars="0"
xdebug.default_enable="1"
xdebug.extended_info="1"
xdebug.manual_url="http://www.php.net"
xdebug.max_nesting_level="100"
xdebug.show_exception_trace="0"
xdebug.show_local_vars="0"
xdebug.show_mem_delta="0"
xdebug.dump.COOKIE="NULL"
xdebug.dump.ENV="NULL"
xdebug.dump.FILES="NULL"
xdebug.dump.GET="NULL"
xdebug.dump.POST="NULL"
xdebug.dump.REQUEST="NULL"
xdebug.dump.SERVER="NULL"
xdebug.dump.SESSION="NULL"
xdebug.dump_globals="1"
xdebug.dump_once="1"
xdebug.dump_undefined="0"
xdebug.profiler_enable="0"
xdebug.profiler_output_dir="/tmp"
xdebug.profiler_output_name="cachegrind.out.%p"
xdebug.profiler_enable_trigger="0"
xdebug.profiler_append="0"
xdebug.profiler_aggregate="0"
xdebug.remote_enable="1"
xdebug.remote_handler="dbgp"
xdebug.remote_connect_back="1"
#xdebug.remote_host="localhost"
xdebug.remote_mode="req"
xdebug.remote_port="9000"
xdebug.remote_autostart="1"
xdebug.remote_log="/tmp/xdebug.log"
xdebug.idekey="my-php-54"
xdebug.var_display_max_data="512"
xdebug.var_display_max_depth="2"
xdebug.var_display_max_children="128"


I am not sure what that off bit at the end of the netstat command means. So this one has me stumped.
_________________
Harold Naparst
Back to top
View user's profile Send private message
hnaparst
Apprentice
Apprentice


Joined: 27 Jul 2005
Posts: 215
Location: Hertfordshire, UK

PostPosted: Mon Aug 26, 2013 7:57 am    Post subject: Reply with quote

A bit more information. I installed wireshark on my PC and looked at the traffic generated from the browser request. There was no incoming or outgoing traffic on port 9000. Just three requests on port 80 to the remote server, along with responses. The responses were on high-number ports, like 49765.

On the remote linux box:

# tcpdump -nnvvXSx port 9000
Code:
error : ret -1
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
08:23:26.219251 IP (tos 0x0, ttl 64, id 5077, offset 0, flags [DF], proto TCP (6), length 60)
    remote-server.44988 > home-pc.9000: Flags [S], cksum 0x73a4 (incorrect -> 0xd61e), seq 1314151179, win 14600, options [mss 1460,sackOK,TS val 4278494 ecr 0,nop,wscale 7], length 0
        0x0000:  4500 003c 13d5 4000 4006 b371 ac1f 14cf  E..<..@.@..q....
        0x0010:  56b2 5bd5 afbc 2328 4e54 5b0b 0000 0000  V.[...#(NT[.....
        0x0020:  a002 3908 73a4 0000 0204 05b4 0402 080a  ..9.s...........
        0x0030:  0041 48de 0000 0000 0103 0307            .AH.........
08:23:26.260047 IP (tos 0x78, ttl 114, id 2718, offset 0, flags [DF], proto TCP (6), length 40)
    home-pc.9000 > remote-server.44988: Flags [R.], cksum 0xc015 (correct), seq 0, ack 1314151180, win 0, length 0
        0x0000:  4578 0028 0a9e 4000 7206 8a44 56b2 5bd5  Ex.(..@.r..DV.[.
        0x0010:  ac1f 14cf 2328 afbc 0000 0000 4e54 5b0c  ....#(......NT[.
        0x0020:  5014 0000 c015 0000                      P.......

_________________
Harold Naparst
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
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