Wednesday 5 June 2013

Set up remote PHP debugging on Ubuntu in Netbeans

This is the configuration I found works (after installing everything that's needed) to get remote debugging in Netbeans for a site running on an Ubuntu server with Apache2.

(/etc/php5/apache2/conf.d/20-xdebug.ini

zend_extension=/usr/lib/php5/20100525/xdebug.so
xdebug.max_nesting_level=2000

xdebug.remote_enable=On
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_connect_back = 1
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_name = cachegrind.out.%t.%p

You also need to set up a path mapping in Netbeans like this:  https://blogs.oracle.com/netbeansphp/entry/path_mapping_in_php_debugger

Restart apache...