$ sudo apt-get install php5-dev php-pear
$ sudo pecl install xdebug
Open file /etc/php5/fpm/php.ini
$ sudo nano /etc/php5/fpm/php.ini
add the following line to the “Dynamic Extensions” section:
[xdebug]
zend_extension="/usr/lib/php5/20121212/xdebug.so"
xdebug.remote_port=9000
xdebug.remote_enable=On
xdebug.remote_connect_back=On
xdebug.remote_log=/var/log/xdebug.log
Restart PHP:
$ sudo service php5-fpm restart
http://blog.shahariaazam.com/enable-xdebug-in-nginx/#.VKY8wGZdksk
http://www.bravo-kernel.com/2014/09/how-to-set-up-xdebug-for-php5-fpm-on-ubuntu/