NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Wont connect to XDebug
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    NetBeans Forums -> PHP Users
View previous topic :: View next topic  
Author Message
denious



Joined: 16 Jul 2010
Posts: 1

PostPosted: Fri Jul 16, 2010 1:21 pm    Post subject: Unable to bind Reply with quote

Same issue here, running:

    > Windows 7 Professional x64
    * NetBeans 6.9
    * Apache HTTP Server 2.2
    * PHP 5.3.2 VC6
    * Xdebug 2.1.0-5.3 VC6

phpinfo()
Code:
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans


Code:
xdebug.remote_enable    On
xdebug.remote_handler   dbgp
xdebug.remote_host      127.0.0.1
xdebug.remote_mode      req
xdebug.remote_port      9000


If I run the test script I get:
Code:
Unable to bind


Has anybody found a solution for this? I have been looking around for a week now.


Last edited by denious on Mon Jul 19, 2010 12:52 am; edited 3 times in total
Back to top
schkovich



Joined: 17 Mar 2010
Posts: 487
Location: Swieqi, Malta

PostPosted: Fri Jul 16, 2010 4:26 pm    Post subject: Reply with quote

Working like a charm. Smile

Product Version: NetBeans IDE 6.9.1 Dev (Build 201006282301)
Java: 1.6.0_20; Java HotSpot(TM) 64-Bit Server VM 16.3-b01
System: Linux version 2.6.32-23-generic running on amd64; UTF-8; en_US (nb)

PHP Version 5.3.2-1ubuntu4.2
System Linux 2.6.32-23-generic #37-Ubuntu SMP Fri Jun 11 08:03:28 UTC 2010 x86_64
Build Date May 13 2010 19:54:32
Server API Apache 2.0 Handler

Quote:
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Xdebug v2.1.0beta3, Copyright (c) 2002-2010, by Derick Rethans
with Suhosin v0.9.29, Copyright (c) 2007, by SektionEins GmbH


Code:
;zend_extension="/usr/lib/php5/20090626/xdebug.so"
zend_extension="/opt/xdebug/xdebug.so"
xdebug.profiler_enable_trigger=On
xdebug.profiler_output_dir=/tmp
xdebug.remote_enable=On
xdebug.remote_host="xuz.org"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_log=/home/userhome/www/xdebug.log
xdebug.extended_info=On
Back to top
maghiel



Joined: 08 Oct 2009
Posts: 43

PostPosted: Sun Jul 18, 2010 12:41 am    Post subject: Wont connect to XDebug Reply with quote

I'm waiting for Zend Debugger to be supported for quite long,
see http://netbeans.org/bugzilla/show_bug.cgi?id=168275

On 16-7-2010 5:17, Sameer wrote:
Quote:
^^^ I am having the same problem (with windows XP).

This seems to be a very difficult issue with xdebug, people have been having trouble for a long time.

Is there a way to try any other debugger?





Back to top
alanms



Joined: 13 Aug 2010
Posts: 1

PostPosted: Fri Aug 13, 2010 1:05 am    Post subject: Reply with quote

YEEEEEEEEEESSSSSSSSS got xdebug working on Netbeans after a CRAZY amount of hard work and stress.

Sadly there's no one miracle cure but here's some tips I picked up on the way. Hopefully they will be of some use to someone!

1: Read http://devzone.zend.com/article/2803-Introducing-xdebug parts 1 and 4.

A big problem is poor quality of writing in documentation. Here's a great set of articles that explain xDebug in clear, coherent, plain English - naturally, written by a German Smile

So, my first tip: Take a break, make a coffee, and read Stefan Priedsch's articles at http://devzone.zend.com/article/2803-Introducing-xdebug - particularly, parts 1 and 4

There's some crucial subtle details and context you might not already understand. Also, it'll remind you why it's worth all this effort!

2: Use http://www.xdebug.org/find-binary.php

Many xDebug problems seem to come from tiny mismatches between the exact PHP release you use, and the exact version of xDebug you use. If you simply downloaded the latest version xdebug, or if you got xdebug off a repository, this is probably part of your problem.

Helpfully, the xdebug guys have an app on their site where you can copy and paste in your PHPinfo, and it gives you the correct version with step-by-step compilation instructions. Use it! http://www.xdebug.org/find-binary.php

3: Get xdebug's debugclient working on localhost first, then add Netbeans.

If Netbeans is failing to connect, chances are it's a problem with xDebug and nothing to do with Netbeans. First, try to achieve the simplest possible xDebug set up: use the bundled command line client "debugclient" instead of netbeans, on localhost, debugging simple php code (e.g. a phpinfo file), with any firewalls and other competing factors or config disabled or removed. When you've got this running, then your fight with Netbeans will be on solid ground, and will probably be surprisingly easy.

Instructions on installing Debugclient are cunningly hidden right at the bottom of http://www.xdebug.org/docs/install

As for actually using it, there's almost nothing I could find on xdebug's own site, but there's good tips on the really helpful page http://www.thierryb.net/pdtwiki/index.php?title=Using_PDT_:_Installation_:_Installing_the_XDebug_Debugger - look under "Can I debug locally?" near the bottom. The important thing is, if debugclient hangs on "Waiting to connect", it hasn't necessarily failed, it could be working and listening for a session from your browser.

I personally went as far as setting up an Ubuntu Virtualbox on my Windows machine. This took all Windows-related complications out of the equation, and meant I could casually wipe the whole drive and start all over again when things got complicated. I'd recommend this as it gives you complete control and guarentees no conflicting config files. People have spent days, even more than a week or two fighting to get xdebug to work - spend time now to save time later!

Here's a collection of tips I picked up from 100s of forum posts and from experience:-

- Always check there aren't any other php.ini files you haven't configured (on *nix, "find / -name php.ini"). E.g. there are often different php.inis for command line and for web server PHP.

- (on *nix) Use the command "netstat -a | grep tcp" when you need to see what's going on with port 9000

- Generally, 'fail to bind' type errors are a sign that something is using the port in question. If netstat says port 9000 is busy listening, this is what it's supposed to do. It might be waiting for a browser to start a session - try it! I think http://www.thierryb.net/pdtwiki/index.php?title=Using_PDT_:_Installation_:_Installing_the_XDebug_Debugger has how.

- Only use those socket-based php test files like http://blogs.sun.com/netbeansphp/entry/howto_check_xdebug_installation sparingly. When they hang, they can tie up the port and complicate the question. Reboot and restart Apache often. Also, don't forget to try them through a browser as well as the command line. If this gives you a fancy error screen with backtraces and some orange colouring, that's a good sign - that's xdebug at work!

- Don't obssess over every php.ini option. Most of the defaults are fine. The really important ones are the host, and making sure that whatever port you set in php.ini is matched by your client.

- Occasionally, on some systems, localhost isn't localhost. If this might effect you (it probably doesn't), put 127.0.0.1 instead.

- Look at your other debugging-related php.ini settings. Turn them on. This isn't essential, but it helps a lot. I also uncommented the report_zend_debug = 0 line to make sure that this is off and not competing. I don't know if this helped, but xdebug now works, so it didn't hurt.

- In your phpinfo, check that "Debug build" IS "No". If it's "yes", this could be a big problem. Research it. I believe you might need to reinstall PHP, to make sure that it is "no".

- Make sure there's nothing Zend other than xDebug in either phpinfo, php -m on the command line (if you've got command line php) or php.ini. If there's any other Zend modules in php.ini, comment them out.
Back to top
schkovich



Joined: 17 Mar 2010
Posts: 487
Location: Swieqi, Malta

PostPosted: Fri Aug 13, 2010 9:57 am    Post subject: Reply with quote

Awesome post. I did have a single problem only: Variables values where not displayed withing the NetBeans. Using Komodo unofficial XDebug 2.1.0 release instead default Ubuntu did the trick. Therefore I do agree: Matching PHP and XDebug version does matter. Smile
Back to top
Istvan Gouritz
Posted via mailing list.





PostPosted: Fri Aug 13, 2010 10:44 am    Post subject: Wont connect to XDebug Reply with quote

If one not sure which version of xdebug to use, homepage provide
awesome online script which analyse your info php output and displays
which version to download and how to edit php.ini.

http://www.xdebug.org/find-binary.php
"
This page helps you finding which file to download, and how to configure
PHP to get Xdebug running. Please paste the full output of
phpinfo() (either a copy & paste of the HTML version, the HTML source
or php -i output) and submit the form to receive tailored
download and installation instructions. Do not paste the raw HTML (from
view-source) into the form.
"

On Fri, Aug 13, 2010 at 11:58 AM, schkovich <address-removed> wrote:
Quote:

Awesome post. I did have a single problem only: Variables values where not displayed withing the NetBeans. Using Komodo unofficial XDebug 2.1.0 release (http://code.activestate.com/komodo/remotedebugging/) instead default Ubuntu did the trick. Therefore I do agree: Matching PHP and XDebug version does matter. :)

------------------------
Schkovich at LinkedIn (http://www.linkedin.com/in/goranmiskovic)
Buzz by Schkovich (http://www.google.com/profiles/schkovich#buzz)



Back to top
datarecovery



Joined: 21 Aug 2010
Posts: 1

PostPosted: Sat Aug 21, 2010 7:53 am    Post subject: Reply with quote

I installed each packet separately. I still get netbeans waiting for connection. No matter if IE or FF.
I have tried all the SDebug config in php.ini suggested here. Still nothing.
Phpinfo shows me all the correct info on xdebug (so it should be installed correctly) and port 9000 is the correct port also in phpinfo...

Any idea?


Carin
File Recovery
Back to top
onman



Joined: 22 Aug 2010
Posts: 1

PostPosted: Sun Aug 22, 2010 8:46 pm    Post subject: Reply with quote

I did everything I could find on any site. But no luck in getting xdebug running.

Through the site mentioned in one of the posts above I found out which xdebug version to use.
I got it going with the debugclient. But still, netbeans is waiting to connect...
I guess the problem is with netbeans: either it has a problem in the software or its configuration settings need some manual adjusting (which ones?).

I've absolutely no idea of what I can do to get my debugging working (other than abandoning the further great netbeans).
Anyone has exact details on how to configure xdebug in netbeans?
Back to top
Paolo Scarabelli
Posted via mailing list.





PostPosted: Mon Aug 23, 2010 10:16 am    Post subject: Wont connect to XDebug Reply with quote

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Try to isolate the problem, if you work locally try with a different
xdebug client.

If you are in a client server environment you can try start the project
debug on netbeans then nmap the server for the xdebug port. If the port
is open and visible try with a different xdebug client. If the port is
close try with a client directly on the server.

If nothing works then you are almost sure it has to do with xdebug itself.

I remember a thread some time ago, the user couldn't get xdebug to work
and at the end it was just the firewall blocking the xdebug port.


Regards,


Paolo.


On Monday 23,August,2010 04:46 AM, onman wrote:
Quote:
I did everything I could find on any site. But no luck in getting xdebug running.

Through the site mentioned in one of the posts above I found out which xdebug version to use.
I got it going with the debugclient. But still, netbeans is waiting to connect...
I guess the problem is with netbeans: either it has a problem in the software or its configuration settings need some manual adjusting (which ones?).

I've absolutely no idea of what I can do to get my debugging working (other than abandoning the further great netbeans).
Anyone has exact details on how to configure xdebug in netbeans?






-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxySGMACgkQqAaEpZvj+VNbjQCfYKz51BNYKNDP9egCr58ghp9c
hagAn1I5Ai49WTmMNX22snM+kwhT6rqD
=nmwH
-----END PGP SIGNATURE-----
Back to top
Filip Zamboj
Posted via mailing list.





PostPosted: Mon Aug 23, 2010 12:13 pm    Post subject: Wont connect to XDebug Reply with quote

Hi,

if you are using latest netbeans 6.9.1 or development build then I don't
really think it is a netbeans bug. I made it working on XP, Vista,
Ubuntu (Karmic Koala) and Snow Leopard. It's not really sure if you are
trying to debug remotely or locally. For remote debugging path mapping
may be required (not necessarily). Usual mistakes are closed port 9000,
wrong xdebug version, path mapping problems, using wrong php.ini ... You
can get many information from xdebug log xdebug.remote_log="path_to_log"
(see xdebug page for details), apache log and netbeans log (see
http://wiki.netbeans.org/HowToConfigureXDebug for information on
logging). This document
http://blogs.sun.com/netbeansphp/entry/howto_check_xdebug_installation
may be helpful as well.

Regards,

Filip Zamboj
Sun Microsystems

[1] http://www.netbeans.org/community/issues.html
[2] http://qa.netbeans.org
[3] http://wiki.netbeans.org/HowToConfigureXDebug
[4] http://bertram.netbeans.org/hudson/job/PHP-build


On 08/22/2010 10:46 PM, onman wrote:
Quote:
I did everything I could find on any site. But no luck in getting xdebug running.

Through the site mentioned in one of the posts above I found out which xdebug version to use.
I got it going with the debugclient. But still, netbeans is waiting to connect...
I guess the problem is with netbeans: either it has a problem in the software or its configuration settings need some manual adjusting (which ones?).

I've absolutely no idea of what I can do to get my debugging working (other than abandoning the further great netbeans).
Anyone has exact details on how to configure xdebug in netbeans?




Back to top
CandaVespin



Joined: 03 Sep 2010
Posts: 1
Location: Vancouver, WA

PostPosted: Fri Sep 03, 2010 6:13 pm    Post subject: Reply with quote

I've been trying to get xDebug to work with Netbeans for... a while now. I am able to get it to work just fine with Eclipse IDE, but it's a pain to have to switch between IDEs just so I can perform debugging.

I've checked all of the PHP settings, I've followed all of the suggestions in this site above, and I still keep getting errors. When I view my xdebug error log, immediately after an attempt to debug, I get the following:
Code:
Log opened at 2010-09-03 19:36:11
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file://<LOCAL FILEPATH>/index.php" language="PHP" protocol_version="1.0" appid="6084" idekey="netbeans-xdebug"><engine version="2.1.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2010 by Derick Rethans]]></copyright></init>

<- stop -i 2
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stop" transaction_id="2" status="stopped" reason="ok"></response>

-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stop" transaction_id="2" status="stopping" reason="ok"></response>

Log closed at 2010-09-03 19:36:44


The primary issue I have is the same as others have mentioned. The browser opens and hangs at "waiting for [localhost]..." When I stop the debugger, I get a "DEBUG SESSION HAS ENDED" or something to that effect.

Suggestions? It's odd to me that xDebug works in one IDE and not the other. This indicates a NB problem to me.

Environment:
Windows 7 Home Premium x32
WAMP 2.0
Apache 2.2.11
PHP 5.3.0

XDebug Configuration [phpinfo() confirms xdebug is running]:
zend_extension = c:\wamp\bin\php\php5.3.0\ext\php_xdebug-2.1.0-5.3-vc6.dll
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_log="C:\wamp\logs\xdebug_error.log"
xdebug.profiler_enable=1
xdebug.profiler_output_dir="c:\wamp\tmp"
xdebug.idekey="netbeans-xdebug"
Back to top
FergalMohan



Joined: 30 Sep 2010
Posts: 1

PostPosted: Thu Sep 30, 2010 12:04 pm    Post subject: Reply with quote

I struggled with this for 2 days with NetBeans on my Windows XP box, so JIC it helps anyone else my problem ended up being solved by adding the line
zend_extension = <ENTER YOUR PATH>\php\ext\php_xdebug-2.1.0-5.2-vc6.dll"
instead of
;extension=php_xdebug.dll
in my php.ini file (path and filename need to be corrected).
My phpInfo was complaining about xDebug not being a Zend Extension so I made and educated guess. Worked for me, YMMV, Good Luck.
Back to top
Peter Swietoslawski



Joined: 30 Oct 2009
Posts: 2

PostPosted: Mon Oct 04, 2010 3:24 pm    Post subject: Same problem on OS X Reply with quote

I was using Netbeans 6.8 with Xdebug 2.1.0 and everything worked fine. I've upgraded to 6.9 (Tried 6.10 M1 and latest dev build 20101004000 as well) and started having issues. I can run debugging session fine on freshly started Netbeans 6.9+. However stopping session and restarting results in Netbeans firing up borwser and hanging with:
Waiting for connection

I've downgraded to Netbeans 6.8 and everything is working again.

That clearly suggests a bug in 6.9+.
Back to top
codekiln



Joined: 17 Oct 2010
Posts: 1

PostPosted: Sun Oct 17, 2010 10:41 pm    Post subject: How to debug Netbeans port connection to XDebug: “Waiting to Connect” Reply with quote

Preamble
Like many, I've spent more hours debugging my IDE’s connection to XDebug than I have using XDebug to debug my programs. I’ve gotten it to work repeatedly, but every once and a while I get the common “Waiting to connect” problem. I haven’t been able to localize what causes XDebug to work or fail. I’ve been using ubuntu for two years; I’m neither a noob nor an strace guru. What am I doing wrong? How can I better debug my IDE’s connection to XDebug?

Setup
Ubuntu 10.10
Netbeans 6.9.1
PHP 5.3.3-1ubuntu9 with Suhosin-Patch
Xdebug v2.1.0 with debugclient built Sep 20 2010 from source using the tailored installation instructions script on xdebug.org
Apache Apache/2.2.16
Both /etc/php5/apache2/php.ini and /etc/php5/cli/php.ini have:
zend_extension = /usr/lib/php5/20090626+lfs/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_log=/var/log/xdebug.log
xdebug.extended_info=1
xdebug.idekey="netbeans-xdebug"

Procedure

The Problem
I can't explain what causes the problem or when the problem manifests. It begins when I try to debug my project, which causes my dev browser of choice (Chrome) to open to the url of my project with the parameter XDEBUG_SESSION_START=netbeans-xdebug. This causes the page to render normally in chrome while Netbeans reports only “Waiting to Connect.”

Debugging XDebug
First, with the “Waiting to Connect” message still alive, I’ll try to use netstat to dig around port 9000, which goes something like this:

$ netstat -an | grep 9000
tcp6 0 0 :::9000 :::* LISTEN
I shut down my IDE and try to use two files to help figure out what’s going on: {webroot}/index.php contains <?php phpinfo(); ?>, and {webroot}/dbgtest.php contains the XDebug installation check script:

<?php
$address = '127.0.0.1';
$port = 9000;
$sock = socket_create(AF_INET, SOCK_STREAM, 0);
socket_bind($sock, $address, $port) or die('Unable to bind');
socket_listen($sock);
$client = socket_accept($sock);
echo "connection established: $client";
socket_close($client);
socket_close($sock);
?>

When I start the XDebug debugclient and open http://127.0.0.1/dbgtest.php?XDEBUG_SESSION_START=mysession, I’ll usually get the regular output and then verify XDebug is connected to the script with netstat in another terminal:

$ netstat -an | grep 9000
tcp 0 0 127.0.0.1:9000 127.0.0.1:34831 ESTABLISHED
tcp 0 0 127.0.0.1:34831 127.0.0.1:9000 ESTABLISHED

I Ctrl-c to quit debugclient, and netstat at this point verifies that port 9000 has no activity. I fire up Netbeans, open {webroot}/index.php and engage the debugger, which opens up http://127.0.0.1/index.php. The debugger then usually starts normally. I stop the debugger, go back to my project, and this is where the problem really becomes annoying: some of the time, I can continue debugging my project as normal, and other times, the problem re-emerges and while the “Waiting to Connect” sign is displaying, netstat shows:

$ netstat -an | grep 9000
tcp6 0 0 :::9000 :::* LISTEN
tcp6 0 0 127.0.0.1:9000 127.0.0.1:34681 TIME_WAIT
Other times, I'll restart my computer, fire up a terminal, and find:

$ netstat -an | grep 9000
unix 3 [ ] STREAM CONNECTED 9000
$ telnet 127.0.0.1 9000
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

I'm not familiar enough with network and linux internals to see what this points to. Clearly something is using port 9000. What does this mean? Note that despite my settings in php.ini:

$ cat /var/log/xdebug.log
cat: /var/log/xdebug.log: No such file or directory
What is the correct way to debug the connection between the IDE and XDebug?[/url]
Back to top
schkovich



Joined: 17 Mar 2010
Posts: 487
Location: Swieqi, Malta

PostPosted: Tue Oct 19, 2010 8:04 am    Post subject: Re: How to debug Netbeans port connection to XDebug: “Waiting to Connect” Reply with quote

Setup
Similar to yours but I am using binaries from Komodo.

The Problem
None. Smile

Check if /var/log/xdebug.log is writable by www-data
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> PHP Users All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
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
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo