Friday 17 October 2014

How to enable Xdebugger in Netbeans in Ubuntu


  1. Install the latest version of xdebug in PEAR repository:

  1. sudo apt-get install php5-dev php-pear
  2. Install xdebug through PECL:

  1. sudo pecl install xdebug
  2. Now, you need to find the path of the compiled module (xdebug.so):

  1. find / -name 'xdebug.so'
  2. Copy the found file-path to use in the next steps.
  3. Now we need to configure xdebug with PHP5, so open the php.ini file (usually you'll find it in /etc/php/apache2/php.ini) use gedit to edit the file:

  1. sudo gedit /etc/php/apache2/php.ini
  2. OR, use the pwerful text editor vim:

  1. sudo vim /etc/php/apache2/php.ini
  2. Add the following lines to the file [Note that the first line should contain the file path found in step number 3]:

  1. zend_extension="/usr/lib/php5/20060613/xdebug.so"
    xdebug.remote_enable=1
    xdebug.remote_handler=dbgp
    xdebug.remote_mode=req
    xdebug.remote_host=localhost
    xdebug.remote_port=9000
  2. Finally, you need to restart apache for the changes to take effect:

  1. sudo /etc/init.d/apache2 restart

No comments:

Post a Comment