Why doesn't xdebug connect to NetBeans?

I am trying to use xdebug with NetBeans to debug PHP. I run debug and NetBeans waits forever for a connection to xdebug. I have NetBeans 6.8 (latest version) with the latest MAMP package installed on my Mac.

My php.ini looks like this:

[xdebug] ;zend_extension="/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so" xdebug.remote_enable=on xdebug.remote_handler=dbgp xdebug.remote_mode=req xdebug.remote_host=localhost xdebug.remote_port=9000 
+8
php xdebug netbeans
Dec 22 '09 at 14:22
source share
7 answers

If your php.ini really looks like what you submitted, you need to undo the comment on the zend_extension line (ie remove the " ; " at the beginning of its existence), so Xdebug is loaded.

Then make sure Xdebug is loaded by calling phpinfo() from the PHP file (just to make sure).

After that: I suppose there should be some options for setting up the debugger in netbeans? If so, is netbeans listening on port 9000? (The one you configured in php.ini)

+9
Dec 22 '09 at 14:24
source share

Finally, I had to add the idekey value as follows:

 xdebug.idekey="netbeans-xdebug" 

now it works :-)

+10
Dec 22 '09 at 15:52
source share

The following options worked for me with NetBeans 7.2 on Mountain Lion after restarting Apache:

 zend_extension = /usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so xdebug.remote_autostart=on xdebug.remote_enable=on xdebug.remote_handler=dbgp xdebug.remote_host=127.0.0.1 xdebug.remote_port=9000 xdebug.remote_mode=req xdebug.idekey="netbeans-xdebug" 
+6
Aug 23 2018-12-12T00:
source share

Mac / MAMP users: if you tried all this and still don't work, restart your Mac. Restarting the servers through MAMP is not enough.

+1
Aug 29 '12 at 14:21
source share

I have successfully used XAMPP 1.8.2 and NetBeans 7.4 with success.

 [XDebug] zend_extension = "C:\xampp\php\ext\php_xdebug.dll" xdebug.idekey="netbeans-xdebug" xdebug.profiler_append = 0 xdebug.profiler_enable = 1 xdebug.profiler_enable_trigger = 0 xdebug.profiler_output_dir = "C:\xampp\tmp" xdebug.profiler_output_name = "cachegrind.out.%t-%s" xdebug.remote_enable = on xdebug.remote_enable = 1 xdebug.remote_handler = "dbgp" xdebug.remote_mode=req xdebug.remote_host = "localhost" xdebug.trace_output_dir = "C:\xampp\tmp" 
+1
Dec 30 '14 at 17:04
source share

it worked for me (thank you guys +1) / o /

 <pre> zend_extension = "c:\xampp\php\ext\php_xdebug2.dll" xdebug.remote_autostart=on xdebug.remote_enable=on xdebug.remote_enable=1 xdebug.remote_handler"dbgp" xdebug.remote_host="localhost" xdebug.remote_port=9000 xdebug.remote_mode=req xdebug.idekey="netbeans-xdebug" </pre> 

Configuration:
netbeans 7.3 - php 5.4 - xdebug 2.2 - xampp - win7 (32bits)

0
Apr 08 '13 at
source share

I read that xdebug does not work with the version of PHP that comes with OS X. I got it to work by upgrading php from version 5.4 to 5.5 using the convenient package from php-osx.liip.ch, including the precompiled xdebug extension. Use this command:

 curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5 

Please note that this will leave your default php installation intact, but disable it in httpd.conf. Your new php.ini will be located in the folder / usr / local / php 5 / lib / php.ini, with the xdebug configuration file on the page "/usr/local/php5/php.d/50-extension-xdebug.ini".

Setup: OS X version 10.9.2

Sources: http://coolestguidesontheplanet.com/upgrade-to-php-5-4-or-5-5-mac-osx-10-8-mountain-lion/

0
Mar 28 '14 at 0:02
source share



All Articles