Remote debug with Eclipse PDT and XDebug [message #893383] |
Tue, 03 July 2012 19:04 |
Milovan Krivokapic Messages: 3 Registered: July 2012 |
Junior Member |
|
|
Hi,
I have a following idea and a problem in its realization.
Idea is to have a server where my projects are hosted and where XDebug is configured and installed. On other side, I have my workstation with Eclipse where I load project from server through sshfs (mounting remote folder) and then debug it by using XDebug on server. That means my workstation stays "clean", no local Apache or any other unnecessary software.
Here is my setup:
- server is in virtual machine (latest stable Debian) and fully configured as a development server; it has Apache, MySQL, Aegir, XDebug(...)
- workstation (Linux Mint) is also host for server's virtual machine. It has only Eclipse and server's project folder mounted through sshfs and imported via File System into a PHP project in Eclipse
Server configuration:
sudo apt-get install php5-xdebug
/etc/php5/conf.d/xdebug.ini content:
zend_extension=/usr/lib/php5/20090626/xdebug.so
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host="192.168.1.101"
xdebug.remote_port=10002
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_dir=/home/milovan
where remote_host is IP address of my workstation, and I also use non default port.
On a workstation, I have configured XDebug in Eclipse like this:
port 10002
show super globals
Max array depth 4
Max children 31
Multisession (off)
JIT off
and a server in Eclipse like this:
Base URL is a link to the website I am debugging (I have everything configured in /etc/hosts on server and workstation as domain is local only)
Local Web Root is blank
In Path mapping I set path on the server to the project folder and local path to the project
The problem is following:
when I start "remote" debugging, Eclipse shows Waiting for XDebug session and hangs there on 57%.
I ran netstat -anp -t tcp | grep 10002 and got:
server: tcp 0 1 192.168.1.52:48395 192.168.1.101:10002 SYN_SENT 9537/apache2
workstation: tcp6 0 0 :::10002 :::* LISTEN 21942/java
so I think I am getting there, just I am missing something. Anyone have a clue whats the problem, where to look next or some option to try? I am trying to figure this out for a couple of days and tried numerous XDebug configurations with no luck. I also enabled the port I am using for XDebug in Firestarter on my workstation.
Just one note, I mounted project dir on one test machine and was able to debug just fine in localhost (machine has Apache, Mysql, XDebug..) but the idea is that client (workstation) use all that from a server.
If anyone has a solution or some references to this problem, I d appreciate it.
Thanks in advance!
|
|
|
Re: Remote debug with Eclipse PDT and XDebug [message #893408 is a reply to message #893383] |
Wed, 04 July 2012 01:37 |
Toshihiro Izumi Messages: 360 Registered: July 2009 Location: Japan |
Senior Member |
|
|
> I ran netstat -anp -t tcp | grep 10002 and got:
> server: tcp 0 1 192.168.1.52:48395 192.168.1.101:10002 SYN_SENT 9537/apache2
> workstation: tcp6 0 0 :::10002 :::* LISTEN 21942/java
Why you can make communication between ipv4 and ipv6.
Disable ipv6 on your workstation. (I'm sorry but I don't know how to force only xdebug on workstation to use ipv4.)
(other settings seem to be good)
[edited for late comers]
Disabling ipv6 is not necessary.
I could reproduce this issue on my Ubuntu 12.04 and disabling ipv6 solved it, I thought. However, it was wrong. There is no problem at least on Ubuntu 12.04, I confirmed it with new installation on the vmware hosted by WindowsXP. Xdebug works fine. No problem.
>tcp6 0 0 [::]:9000 [::]:* LISTEN
>tcp6 0 0 192.168.204.128%30:9000 192.168.204.1%1:1694 ESTABLISHED
[Updated on: Thu, 05 July 2012 06:40] Report message to a moderator
|
|
|
|
|
Re: Remote debug with Eclipse PDT and XDebug [message #893589 is a reply to message #893584] |
Wed, 04 July 2012 17:46 |
Milovan Krivokapic Messages: 3 Registered: July 2012 |
Junior Member |
|
|
Hey thanks! I am using atm Java 6. So this was the version of Java I used until now on my workstation:
java version "1.6.0_23"
OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre11-0ubuntu1.11.10.2)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)
Now I removed OpenJDK thinking that it might be related to it and installed Sun Java (exactly the same is on server too):
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
but this didnt help. I again started Eclipse (for PHP developers) and still hanging on 57%. I didnt restart my workstation yet, will try as soon as I get a chance to restart it.
Ok, so through netstat we see that server and client are communicating, but in one moment they have a timeout. Is there any other tool useful for debugging this debugger problem? ^^
If anyone else has an idea, I d appreciate any kind of tip, opinion, whatever. Thanks in advance!
One more thing, I tried var_dump and its output looked like it was formatted by XDebug. So just one tiny problem between client and server is missing.
[Updated on: Wed, 04 July 2012 18:12] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04101 seconds