[HOWTO] Configure Netbeans 6.9 to debug PHP files using xdebug in Fedora 14

February 21st, 2011 Permalink

I am using Netbeans 6.9 on Fedora 14 for Web development. I have enabled PHP debugging for making PHP development easier. Here is how you can do it too. Install and enable xdebug Use yum to install php-pecl-xdebug: sudo yum install php-pecl-xdebug Now, open the file /etc/php.d/xdebug.ini in a text editor as root. I use [...]

I am using Netbeans 6.9 on Fedora 14 for Web development. I have enabled PHP debugging for making PHP development easier. Here is how you can do it too.

Install and enable xdebug

Use yum to install php-pecl-xdebug:

sudo yum install php-pecl-xdebug

Now, open the file /etc/php.d/xdebug.ini in a text editor as root. I use nano:

sudo nano /etc/php.d/xdebug.ini

Now , make sure the following options are set enabled in ini:

; Enable xdebug extension module
zend_extension=/usr/lib/php/modules/xdebug.so
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000

Allow port for xdebug

sudo semanage port -a -t http_port_t -p tcp 9000

Restart Apache:

sudo service httpd restart

Configure Netbeans to use PHP debugger

Now, open up the file /usr/share/netbeans/6.9/etc/netbeans.conf in a text editor and add the text “-J-Dorg.netbeans.modules.php.dbgp.level=400″ in netbeans_default_options so that the line looks somewhat like this:

netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true -J-Dorg.netbeans.modules.php.dbgp.level=400"

Restart netbeans and given that you have configured the project directories properly, you should be able to click on the debug button and start debugging PHP file.


If you enjoyed this post, make sure you subscribe to my RSS feed!
  • Saksham

    I need to guest post on your blog, you accept guest posts? Please reply me at the email as here isnt any contact form! :(

  • Pingback: [HOWTO] Setup step debugging PHP in Netbeans on Windows with XAMPP | The _khAttAm_ blog

  • http://www.getaphpprogramer.com php developers

    It’s nice to find a good article. I really enjoy lots of the blog posts on your web site.

  • Guitcastro

    Thanks man ; )

  • Kdoskas

    Really helpful and  straight forward