title: Netbeans waiting for connection to XDEBUG
body: <p>Netbeans won't connect to xdebug. I've tried suggestions from the following posts: </p>
  
  <p><a href="https://stackoverflow.com/questions/3955226/debugging-ides-port-connection-to-xdebug-waiting-to-connect">Debugging IDE&#39;s port connection to XDebug: &quot;Waiting to Connect&quot;</a></p>
  
  <p><a href="https://stackoverflow.com/questions/17613726/netbeans-shows-waiting-for-connection-netbeans-xdebug">netbeans shows &quot;Waiting For Connection (netbeans-xdebug)&quot;</a></p>
  
  <p>but it doesn't fix my issue.</p>
  
  <p>It seems Netbeans connects to xdebug because while it waits for the connection all request made to the webserver [Apache2] are blocked. Also the port [9001] appears to be in use:</p>
  
  <pre><code>roxy@Pixy011 ~ $ sudo nmap -sS -O 127.0.0.1
  
  Starting Nmap 6.00 ( http://nmap.org ) at 2013-11-28 20:48 EST
  Nmap scan report for localhost (127.0.0.1)
  Host is up (0.000029s latency).
  Not shown: 990 closed ports
  PORT     STATE SERVICE
  22/tcp   open  ssh
  139/tcp  open  netbios-ssn
  443/tcp  open  https
  445/tcp  open  microsoft-ds
  631/tcp  open  ipp
  902/tcp  open  iss-realsecure
  3306/tcp open  mysql
  8080/tcp open  http-proxy
  8081/tcp open  blackice-icecap
  9001/tcp open  tor-orport   &lt;---- Opened by java
  </code></pre>
  
  <p>xdebug.ini: [I have confirmed it is loaded in phpinfo()]</p>
  
  <pre><code>zend_extension=/usr/lib/php5/20100525/xdebug.so
  
  xdebug.remote_autostart=1
  xdebug.remote_enable=1
  xdebug.remote_handler="dbgp"
  xdebug.remote_mode="req"
  xdebug.remote_host="127.0.0.1"
  xdebug.remote_port=9001
  xdebug.idekey="netbeans-xdebug"
  </code></pre>
  
  <p>Netbeans configuration:</p>
  
  <pre><code>Debugger port: 9001
  Session ID: netbeans-xdebug
  Stop at first line: Checked
  All other options are unchecked
  </code></pre>
  
  <p>Project properties: </p>
  
  <pre><code>Host: 127.0.0.1
  Port: 9001
  </code></pre>
  
  <p>Edit:
  I've  noticed Netbeans doesn't append the XDEBUG_SESSION_STOP to the URL. I don't think this is related to the issue because Netbeans only opens the page after I close the debugging session.</p>
  
  <p>I've also disabled SELinux</p>