title: How do I get Netbeans and Xdebug to work with NginX
body: <p>I have an Ubuntu 16.10 laptop that I use for testing websites that I develop, and I recently switched from Apache2 to NginX. I use Netbeans and Xdebug to debug my PHP scripts.</p>
  
  <p>Instructions for setting up Xdebug with NginX seemed pretty straightforward. Simply put the following lines in <code>/etc/php/7.0/fpm/conf.d/20-xdebug.ini</code>:</p>
  
  <pre><code>zend_extension=/usr/lib/php/20160303/xdebug.so
  xdebug.remote_port=9000
  xdebug.remote_enable=On
  xdebug.remote_connect_back=On
  xdebug.remote_log=/var/log/xdebug.log
  </code></pre>
  
  <p>... then restart NginX with <code>sudo service nginx restart</code>. But this doesn't work.</p>
  
  <p>I checked for answers on Stack Overflow, and I found <a href="https://stackoverflow.com/a/18579535/184108">this one</a>, which says I need to put the following code in a configuration file, but, it seems to be specific to PHP 5 and I am running PHP 7.0, and also it only refers to an NginX configuration file without specifying which one, so I don't know exactly where to put it.</p>
  
  <pre><code>location / {
          root /var/www/bresson/web/;
          include fastcgi_params;     
          fastcgi_param SCRIPT_FILENAME $document_root/dispatch.php;
          fastcgi_pass unix:/var/run/php5-fpm.sock;
      }
  </code></pre>
  
  <p><strong>How do I connect Xdebug to NginX so that I can debug PHP with Netbeans?</strong></p>