Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Remote Debugging(Setting Up Remote File Browsing and Breakpoints)
Remote Debugging [message #642965] Fri, 03 December 2010 14:27 Go to next message
artist is currently offline artist
Messages: 6
Registered: December 2010
Location: Torrance, CA
Junior Member
I seek help setting up Helios for remote PHP debugging.

The local machine OS is Windows XP.

The remote machine OS is Debian Lenny with a Lighttpd 1.2.28 server. The phpinfo() function shows XDebug is installed.

On Helios I have SSH set up. The connection test passes.

My debug configuration will get to the website I want to do debugging on. Its front page appears on the internal browser when I run debug. But I cannot set breakpoints. There does not seem to be a way to browse the remote files and set breakpoints in them.

In the PHP perspective I see a mirror of the site that exists on my local machine in the PHP Explorer. Setting breakpoints in it does not work.

I need to know how to setup browsing for the remote files and breakpoints setting in them.
Re: Remote Debugging [message #643036 is a reply to message #642965] Fri, 03 December 2010 17:12 Go to previous messageGo to next message
Dave Kelsey is currently offline Dave Kelsey
Messages: 15
Registered: July 2009
Junior Member
try reading
http://www.eclipse.org/pdt/documents/XDebugGuideForPDT2.0.pd f

it may help.

Note that using Remote System Explorer to hold your php files is
unlikely to work with xDebug (never tested). Keep doing what you are
doing by mirroring your site locally in a PHP project.

Dave

On 03/12/2010 14:27, artist@wavenet.org wrote:
> I seek help setting up Helios for remote PHP debugging.
>
> The local machine OS is Windows XP.
>
> The remote machine OS is Debian Lenny with a Lighttpd 1.2.28 server. The
> phpinfo() function shows XDebug is installed.
>
> On Helios I have SSH set up. The connection test passes.
>
> My debug configuration will get to the website I want to do debugging
> on. Its front page appears on the internal browser when I run debug. But
> I cannot set breakpoints. There does not seem to be a way to browse the
> remote files and set breakpoints in them.
>
> In the PHP perspective I see a mirror of the site that exists on my
> local machine in the PHP Explorer. Setting breakpoints in it does not work.
>
> I need to know how to setup browsing for the remote files and
> breakpoints setting in them.
>
Re: Remote Debugging [message #643105 is a reply to message #643036] Sat, 04 December 2010 13:23 Go to previous messageGo to next message
artist is currently offline artist
Messages: 6
Registered: December 2010
Location: Torrance, CA
Junior Member
In section 2.2 of this PDF, which starts on page 3, there is the entry:
xdebug.remote_host=<hostname>
which is to be "the name of the host where your IDE will be running"
Then in the next figure in gives as an example:
xdebug.remote_host="localhost"
My understanding is that IDE = Integrated Development Environment which in my case is Eclipse. This Eclipse is running on my local machine and not my server. So if my understanding is correct this would rule out "localhost" because that would be the remote server. What then would go here? The IP address of my local machine? My local machine does not have a direct connection to the internet. It connects through a router in the house where I live. Would my local machine's name have to be used as a subdomain of the router's IP address on the ISP's network?

[Updated on: Sat, 04 December 2010 13:24]

Report message to a moderator

Re: Remote Debugging [message #643260 is a reply to message #643105] Mon, 06 December 2010 09:50 Go to previous messageGo to next message
Dave Kelsey is currently offline Dave Kelsey
Messages: 15
Registered: July 2009
Junior Member
When yopu configure xdebug you are configuring the part that is linked
to the PHP language itself, not the IDE. PHP can run on a different
machine to where your IDE is running, in this case you need to tell
xdebug on which machine the IDE is running. if your PHP and IDE are on
the same machine, then you would put "localhost" in there.

For more information on configuring xdebug go to
http://www.xdebug.org

Dave

On 04/12/2010 13:23, Stephen wrote:
> In section 2.2 of this PDF, which starts on page 3, there is the entry:
> xdebug.remote_host=<hostname>
> which is to be "the name of the host where your IDE will be running"
> Then in the next figure in gives as an example:
> xdebug.remote_host="localhost"
>
> My understanding is that IDE = Integrated Development Environment which
> in my case is Eclipse. This Eclipse is running on my local machine and
> not my server. So if my understanding is correct this would rule out
> "localhost" because that would be the remote server. What then would go
> here? The IP address of my local machine? My local machine does not have
> a direct connection to the internet. It connects through a router in the
> house where I live. Would my local machine's name have to be used as a
> subdomain of the router's IP address on the ISP's network?
Re: Remote Debugging [message #643633 is a reply to message #643260] Tue, 07 December 2010 17:05 Go to previous messageGo to next message
artist is currently offline artist
Messages: 6
Registered: December 2010
Location: Torrance, CA
Junior Member
Instead of figuring out the hostname I set:
xdebug.remote_connect_back=1
in xdebug.ini. This is not secure but will do for now.

Now my problem is when I start a debug session the webpage takes 11 minutes to load in the Firefox browser, and it does not stop at the breakpoints I set.

My main suspicion is the remote OS firewall. What would be the iptables command to allow xdebug to connect?
Re: Remote Debugging [message #643791 is a reply to message #643633] Wed, 08 December 2010 09:43 Go to previous messageGo to next message
Dave Kelsey is currently offline Dave Kelsey
Messages: 15
Registered: July 2009
Junior Member
Given that you are probably sharing a router that uses NAT, you will
have to configure your router to allow your box to be a server.
Effectively when using xdebug your IDE is the server and your remote box
is a client of your server when you debug.

Alternatively why don't you replicate the remote server environment on
your machine and develop/debug locally, then deploy onto the remote server.

Dave

On 07/12/2010 17:05, Stephen wrote:
> Instead of figuring out the hostname I set:
> xdebug.remote_connect_back=1in xdebug.ini. This is not secure but will
> do for now.
>
> Now my problem is when I start a debug session the webpage takes 11
> minutes to load in the Firefox browser, and it does not stop at the
> breakpoints I set.
>
> My main suspicion is the remote OS firewall. What would be the iptables
> command to allow xdebug to connect?
Re: Remote Debugging [message #671790 is a reply to message #643791] Thu, 19 May 2011 02:02 Go to previous message
David Coll is currently offline David Coll
Messages: 1
Registered: May 2011
Junior Member
I don't know if this issue is closed or not. But here is my experience concerning Stephen query. DON'T use xdebug.remote_connect_back = 1 unless you know exactly how this works. It's not meant to be used in a home cheap switch box.

DO use xdebug.remote_host and xdebug.remote_port correctly using your INTERNAL ip adress. Thus, you should have an intern ip for your server and your workstation. Specify your remote_host to be the workstation (IDE) lan ip.

remote_port should be the same as specified in Eclipse remote debugging port.

--
But then, and here's what got me here, having a remote file system (files not on same computer than IDE), breakpoints won't work correctly.
Break on first line is good.
If I do a (F5) "Step into" code, for aaaall my code, the IDE seems to be able to map where are the breakpoints. But, It won't find them "as one would usually expect it" if I do a simple "Resume" (F8). On a serious framework, the "Step into" solution is long and will crash Eclipse 9 times out of 10.

I was wondering if there was a better solution to "map" the files along with the moment they are used in the script.. ?

[Updated on: Thu, 19 May 2011 02:05]

Report message to a moderator

Previous Topic:Configure "PHP Language library"
Next Topic:Why is it that the developers of eclipse cannot get code formatting right for the web?
Goto Forum:
  


Current Time: Thu Sep 18 13:56:11 GMT 2014

Powered by FUDForum. Page generated in 0.04644 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software