NetBeans Forums - Netbeans & xdebug

kaputmaltwormSoftware and s/w Development

Aug 15, 2012 (5 years and 2 days ago)

405 views

Search:
Back to top

paolosca
Joined: 09 Sep 2010
Posts: 175
Posted: Tue Mar 01, 2011 4:40 pm Post subject: Netbeans & xdebug
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 03/01/2011 11:47 AM, scorn001 wrote:
Quote:
I've been through more posts than I can count, and I've tried many suggestions. None appear to
be working for me.
I've got netbeans 6.9.1, xdebug 2.1.0, and php 5.3.3-7, all running on Debian 6.0/Testing, with
Apache 2.2.16
I've added the following to my php.ini:
--------------------------------------------------------
zend_extension = /usr/lib/php5/20090626+lfs/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_log=/var/log/xdebug.log
xdebug.extended_info=1
xdebug.idekey="netbeans-xdebug"
-----------------------------------------------------------
I can open the 'debugclient' app that comes with xdebug, and when I start open my php app in
my webbrowser with the 'XDEBUG_SESSION_START=mysession and xdebug-netbeans'
parameters, the debugclient app correctly detects the incoming connection on port 9000, and
stops the php app, and everything seems to work fine.
When I use netbeans however, I created my project using the php apps root directory in my
webserver's (on localhost) directory. Then I start debug, I get the 'waiting' status bar ticking back
and forth. I run my app, but nothing happens with netbeans, it continues to wait with the cycling
status bar. Netbeans is supposedly looking on port 9000 from localhost, according to the PHP
configuration dialog.
What's more interesting is that I can still run the debugclient app, and it is able to bind port 9000
without issue, as if Netbeans isn't even using it, it can still detect incoming xdebug connections.
If I open another debug app using port 9000, then debugclient fails, unable to bind the port.
All suggestions I've seen seem to point to xdebug as the source of trouble, but in this case,
xdebug seems to be working perfectly fine, it looks like netbeans isn't really looking for the
incoming connection, or at least not looking on port 9000.
Any help would be greatly appreaciated.
Hi Tim,
I have a similar environment (Debian Testing/Sid) and everything works
(almost) out of the box.
My environment is:
apache2 2.2.17-1
php5 5.3.3-5
php5-xdebug 2.1.0-1
I have another machine with your squeeze and it's working fine as well,
the important is that you install xdebug using apt so the php version
and xdebug versions are sure to be compatible.
Instead of adding the xdebug config parameters to
/etc/php5/apache2/php.ini as you did I added them to
/etc/php5/apache2/conf.d/xdebug.ini:
zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.show_local_vars=1
It shouldn't make any difference if you add the lines to php.ini or
xdebug.ini but I assume at this point you have at least the
"zend_extension=" parameter in both files. If you decide to write the
config in php.ini it's probably better to comment the lines in xdebug.ini.
I don't use php cli so I made no changes in the cli configuration but I
assume it will be enough to mirror the changes you make in the files in
/etc/php5/apache2 to the corresponding files in /etc/php5/cli.
My project configuration options are:
- - Run configuration
- Run as: Run as local website
NetBeans Forums - Netbeans & xdebug
http://forums.netbeans.org/topic36814.html
2 of 6 2011-08-23 23:14
- Project URL:
http://localhost/
- Index file: index.php
- Arguments: [blank]
- Advanced...: [leave default]
- - Debug
- Debug server side php: [checked]
My netbeans options for php are:
- - Debugger port: 9000
- - Session ID: netbeans-xdebug
- - Stop at first line: [checked]
- - Watches and balloon evaluation: [unchecked]
I think I left most of the values (if not all of them) as default. A
note, if you uncheck the "stop at first line" box make sure you add a
breakpoint somewhere in the code or you won't be able to interact with
the debugging process.
Then you just neet to click on the "debug project" button, the icon is a
piece of code with a small play icon in the bottom right side.
You say:
Quote:
When I use netbeans however, I created my project using the php apps
root directory in my webserver's (on localhost) directory. Then I start
debug, I get the 'waiting' status bar ticking back and forth. I run my
app, but nothing happens with netbeans, it continues to wait with the
cycling status bar.
It's not very clear what you mean with "I run my app" but from your
description it could be already working.
Do the debug control buttons appear after you click on the "debug
project" button?
They look similar to media player buttons: A square to stop the
debugging, a circled play button to continue the execution, etc. Be
careful not to confuse the "run project" button which is similar to the
"continue" button.
If the buttons appear you can test the debugger clicking on the "step
into" button which should execute the current line and move to the next.
That's all I can think of now.
Regards,
Paolo.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org/
iEYEARECAAYFAk1tG1sACgkQqAaEpZvj+VMzvQCeKZQ4Pb2XpHcCyBhxcpT1vwC4
FNYAnRfWoqaHyyyxqm4A/Wy30pAD1XXV
=Idnb
-----END PGP SIGNATURE-----
Back to top

scorn001
Joined: 01 Mar 2011
Posts: 5
Posted: Tue Mar 01, 2011 5:23 pm Post subject: Thanks
You are right that I didn't use apt for xdebug, but I did use it for php5. However I did use the 'tailored
installation instruction widget' at xdebug.org that analyzes the php -i output to provide a compatible
xdebug version, which appears to work with other xdebug clients, just not netbeans.
I don't think it is already working because when I do hit the 'stop' button after starting a debug session, it
does tell me that xdebug is likely misconfigured and provides a listing of the config parameters I should be
using, which I am already using of course.
I still find it interesting that even though netbeans claims to be actively monitoring port 9000, port 9000
does not appear to be in use by anything, and other programs can bind, use, and release the port without
issue, netbeans appears oblivious to any of it. However when I use another xdebug client, port 9000
clearly becomes unavailable, as though it is correctly binding the port and is monitoring it.
Thank you for the reply, and I will try your suggestions, including removing xdebug and reinstalling from
NetBeans Forums - Netbeans & xdebug
http://forums.netbeans.org/topic36814.html
3 of 6 2011-08-23 23:14
apt. I just find it fishy that I'm troubleshooting xdebug, when every other xdebug client I've tested
appears to be seeing connections from xdebug without issue, netbeans is the only client I've tried that is
having problems with xdebug.
But I've been wrong in the past, hopefully this will resolve the issue.
Thanks again.
-Tim
Back to top

paolosca
Joined: 09 Sep 2010
Posts: 175
Posted: Tue Mar 01, 2011 6:19 pm Post subject: Netbeans & xdebug
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 03/02/2011 01:23 AM, scorn001 wrote:
Quote:
You are right that I didn't use apt for xdebug, but I did use it for php5. However I did use the
'tailored installation instruction widget' at xdebug.org that analyzes the php -i output to provide a
compatible xdebug version, which appears to work with other xdebug clients, just not netbeans.
I don't think it is already working because when I do hit the 'stop' button after starting a debug
session, it does tell me that xdebug is likely misconfigured and provides a listing of the config
parameters I should be using, which I am already using of course.
I still find it interesting that even though netbeans claims to be actively monitoring port 9000,
port 9000 does not appear to be in use by anything, and other programs can bind, use, and
release the port without issue, netbeans appears oblivious to any of it. However when I use
another xdebug client, port 9000 clearly becomes unavailable, as though it is correctly binding
the port and is monitoring it.
Thank you for the reply, and I will try your suggestions, including removing xdebug and
reinstalling from apt. I just find it fishy that I'm troubleshooting xdebug, when every other
xdebug client I've tested appears to be seeing connections from xdebug without issue, netbeans
is the only client I've tried that is having problems with xdebug.
But I've been wrong in the past, hopefully this will resolve the issue.
Hi Tim,
If I start a debug session with netbeans and I check the ports with
netstat I get the following:
root@saturn:/home/paolo# netstat -pan | grep 9000
tcp 0 0 127.0.0.1:44256
127.0.0.1:9000 ESTABLISHED 20126/apache2
tcp6 0 0 :::9000
:::* LISTEN 24041/java
tcp6 0 0 127.0.0.1:9000
127.0.0.1:44256 ESTABLISHED 24041/java
When I saw tcp6 I suddenly remembered a bug I encountered on squeeze
about a year ago. An update changed the default behavior of ipv6 and
java applications weren't able to use ipv4 anymore:
I guess that if your java wasn't able to use t0he network you would
already found out but just in case:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560044
The workaround was to edit /etc/sysctl.d/bindv6only.conf,
set net.ipv6.bindv6only = 0 and then reboot.
Regards,
Paolo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org/
iEYEARECAAYFAk1tMosACgkQqAaEpZvj+VPc1wCfVb6D8gFplPLWwKWIxGTJh+3C
RIoAmgMN+2IENO1DZbRFA9bPcitleJxv
=tP9B
-----END PGP SIGNATURE-----
Back to top

scorn001
Posted: Tue Mar 01, 2011 8:12 pm Post subject: Interesting....
NetBeans Forums - Netbeans & xdebug
http://forums.netbeans.org/topic36814.html
4 of 6 2011-08-23 23:14