I try using xdebug with NetBeans to debug PHP. I start debug, and NetBeans waits for ever for a connection with xdebug. I have NetBeans 6.8 (latest version) with the latest
Mac/MAMP users: If you have tried all of the above and it still doesn't work, reboot your Mac. Restarting the servers through MAMP is not enough.
Finally, I had to add the idekey value like this:
xdebug.idekey="netbeans-xdebug"
now it works :-)
The following settings 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"
I've read that xdebug doesn't work with the version of PHP what ships with OS X. I got it to work by updating php from version 5.4 to 5.5, using a handy package from php-osx.liip.ch, including precompiled xdebug extension. Use this command:
curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5
Note that this will leave your default php installation intact, but disable it in httpd.conf. Your new php.ini will be at "/usr/local/php5/lib/php.ini", with the xdebug config file at "/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/
If your php.ini really looks like what you posted, you have to un-comment the zend_extension
line (i.e. remove the ';
' at its begninning), so Xdebug is actually loaded.
Then, make sure Xdebug is loaded, calling phpinfo()
from a PHP file (just to be sure).
After that : I suppose there should be some options to configure the debugger in netbeans ? If so, is netbeans listening on port 9000 ? (The one you configured in php.ini)
for me worked this way (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>
Config:
netbeans 7.3 - php 5.4 - xdebug 2.2 - xampp - win7(32bits)