This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 167629 - Breakpoints not working in Netbeans PHP with xdebug
Summary: Breakpoints not working in Netbeans PHP with xdebug
Status: RESOLVED WORKSFORME
Alias: None
Product: php
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker with 1 vote (vote)
Assignee: rmatous
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-25 01:10 UTC by cothedo
Modified: 2011-04-19 17:01 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Error log Netbeans IDE PHP (21.37 KB, text/plain)
2009-06-25 01:12 UTC, cothedo
Details
Error page when trying to run script to check if xdebug is properly installed (5.66 KB, text/html)
2009-06-25 01:14 UTC, cothedo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cothedo 2009-06-25 01:10:56 UTC
Hello,

After posting my problem on the Netbeans forum (here: http://forums.netbeans.org/viewtopic.php?t=13681), Radek Matous
told me to post it as an issue (if I understand correctly).

I can't get xdebug to work correctly. It will debug from the beginning of a php document (by selecting: menu > tools >
options > php > stop at first line (= selected)), but if you unselect "stop at first line", it will not stop at any of
the breakpoints.

There is a blogpost explaining how to check if xdebug is installed properly:
http://blogs.sun.com/netbeansphp/entry/howto_check_xdebug_installation
It lists the following code:

<?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');
$result_listen = socket_listen($sock);
//socket_set_nonblock($sock);
$client = socket_accept($sock);
echo "connection established: $client";
socket_close($client);
socket_close($sock);
?>

When I run this, it stalls at this line: $client = socket_accept($sock);
It won't generate any errors in the Netbeans log, however, this is what I found in the php errorlog:

[24-Jun-2009 05:16:41] PHP   1. {main}() C:\PHP_Websites\Emiel_Stopler_2009\final\debugtest.php:0
[24-Jun-2009 05:25:01] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in
C:\PHP_Websites\Emiel_Stopler_2009\final\debugtest.php on line 7

When I uncomment this line: socket_set_nonblock($sock); (which I added myself, to see what happened), I get this error

> Warning: socket_accept() [function.socket-accept]: unable to accept incoming connection [0]

(I'll attach the html error page).

I use Wampserver 2.0.
Apache Version : 2.2.11  
PHP Version : 5.2.9-2
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with Xdebug v2.0.4, Copyright (c) 2002-2008, by Derick Rethans

Best Regards,
Emiel Stöpler
(The Netherlands)
Comment 1 cothedo 2009-06-25 01:12:54 UTC
Created attachment 84003 [details]
Error log Netbeans IDE PHP
Comment 2 cothedo 2009-06-25 01:14:54 UTC
Created attachment 84004 [details]
Error page when trying to run script to check if xdebug is properly installed
Comment 3 sanilunlu 2009-08-26 02:06:31 UTC
You may try if XDebug config is works using http://code.google.com/p/xdebugclient/ tool. In my PC with Wamp Server 2.0
PHP v5.2.9-2, it works with that tool, but not with NetBeans' XDebug support. It seems connected, but not stops on
breakpoints. There is a way to stop code in a specific point calling xdebug_break(); function. It works, but not
breakpoints. I tried other debugging protocol settings, but not worked too.
Comment 4 Filip Zamboj 2010-01-04 06:22:28 UTC
pachat@netbeans.org: if you want to rise P3 to P1 then provide some arguments, please. 

Last comment from cothedo was made on 2009-06-25 so I'd say he solved it already. Well, we know that connection with xdebug is more problematic than it should be and makes additional troubles with php5.3 but there is not much we can do about it at the moment. 

Installation is described better on http://wiki.netbeans.org/HowToConfigureXDebug.