Install Xdebug with NginX Server | Drupal 8

Install Xdebug with NginX Server

Submitted by editor on Mon, 07/24/2017 - 11:26
Question

How to install and configure Xdebug On NginX with an IDE like Netbeans, Phpstorm ... ?

Install Xdebug php

sudo apt install php-xdebug

Configure Xdebug

Example:
sudo gedit /etc/php/5.6/mods-available/xdebug.ini

Add (Example)
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.var_display_max_depth = -1
xdebug.var_display_max_children = -1
xdebug.var_display_max_data = -1
xdebug.idekey = "netbeans-xdebug"

Restart nginx and php-fem (here php5.6-fpm)

sudo /etc/init.d/nginx restart
sudo /etc/init.d/php5.6-fpm restart
# OR
sudo service nginx restart
sudo service php5.6-fpm restart

Configre IDE (Here Netbeans)

Goto Tools->Options->PHP->Debuging
Set session ID and Debugger Port if different.

Note : Check 'Stop at first line' to test, then uncheck if you do not need.

Tips

On netBeans:
Run your project in debug mode (Ctrl + F5)
View Variables
Step over ( F8 )
Step Into ( F7 )
Step Out ( Ctrl + F7 )
Run to cursor ( F4 )
Continue ( F5 )

 

Tags

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.