title: xDebug seems OK installed, but not connecting with NetBeans
body: <p>I have now tried for hours getting xDebug (2.0.5 compiled from source) to work on my MacBook OS X with NetBeans 6.8. I have installed MAMP and am running a small PHP (5.2) test program with it, no problem. But when I try to debug I get this text in Netbeans: "Waiting for connection (netbeans-xdebug)" and nothing more happens. Netbeans is configured for Debugger Port 9000. No Zend Optimization in MAMP.</p>
  
  <p>I have followed this: <a href="http://netbeans.org/kb/docs/php/configure-php-environment-mac-os.html#installEnableXdebug" rel="nofollow noreferrer">http://netbeans.org/kb/docs/php/configure-php-environment-mac-os.html#installEnableXdebug</a>
  and <a href="http://www.xdebug.org/docs/install" rel="nofollow noreferrer">http://www.xdebug.org/docs/install</a>
  and <a href="http://forums.netbeans.org/topic1513-0-asc-0.html" rel="nofollow noreferrer">http://forums.netbeans.org/topic1513-0-asc-0.html</a> etc</p>
  
  <p>Here is part of my php.ini</p>
  
  <pre><code>[XDebug]
  
  ;zend_extension="/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so"
  
  ;[Zend]
  
  ;zend_optimizer.optimization_level=15
  
  ;zend_extension_manager.optimizer=/Applications/MAMP/bin/php5/zend/lib/Optimizer-3.3.9
  
  ;zend_optimizer.version=3.3.9
  
  ; Xdebug config for Mac OS X and NetBeans IDE
  
  zend_extension=/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so
  
  xdebug.remote_enable=1
  
  xdebug.remote_handler=dbgp
  
  xdebug.remote_mode=req
  
  xdebug.remote_host=localhost
  
  xdebug.remote_port=9000
  
  xdebug.idekey="netbeans-xdebug"
  </code></pre>
  
  <p>I have read a lot of installation instructions etc and phpinfo show that xDebug is installed OK as V.5.2.11 (seen via "Open Start Page" in MAMP). However when i try in terminal PHP -m i do not see xdebug listed. I finally figured that PHP.INI is read from /etc so I copied the MAMP php.ini to php.ini there, thus added the xdebug.se, localhost, port 9000 etc info there. After that xdebug IS listed when I do PHP -m too, but I STILL get the NetBeans problem. Strange enough php -i shows version 5.2.10, not 5.2.11 as above!</p>
  
  <p>I also tried this, adding the "netbeans-xdebug" for idekey: <a href="https://stackoverflow.com/questions/1946643/why-does-xdebug-not-establish-connection-with-netbeans">Why does xdebug not establish connection with NetBeans?</a></p>
  
  <p>How come PHP_INFO() seemed to find my PHP.INI file under ../MAMP/... and not when doing PMP -m when it is read from /etc ?</p>
  
  <p>How can I get PHP to always find the INI file under MAMP so I dont have to use two PHP.INI files to et PHPINFO() and PHP -m to work?</p>
  
  <p>How can I resolve the NetBeans problem now that xDebug seems to be installed correctly but still not working in NetBeans? Something with this need for dual php.ini? Could I have compiled xdebug wrong, how to know? Something with php versions in xdebug / php? How to check?</p>
  
  <p>Here is a part of the result from php -i:</p>
  
  <pre><code>xdebug
  
  xdebug support =&gt; enabled
  Version =&gt; 2.0.4
  
  Supported protocols =&gt; Revision
  DBGp - Common DeBuGger Protocol =&gt; $Revision: 1.125.2.6 $
  GDB - GNU Debugger protocol =&gt; $Revision: 1.87 $
  PHP3 - PHP 3 Debugger protocol =&gt; $Revision: 1.22 $
  
  Directive =&gt; Local Value =&gt; Master Value
  xdebug.auto_trace =&gt; Off =&gt; Off
  xdebug.collect_includes =&gt; On =&gt; On
  xdebug.collect_params =&gt; 0 =&gt; 0
  xdebug.collect_return =&gt; Off =&gt; Off
  xdebug.collect_vars =&gt; Off =&gt; Off
  xdebug.default_enable =&gt; On =&gt; On
  xdebug.dump.COOKIE =&gt; no value =&gt; no value
  xdebug.dump.ENV =&gt; no value =&gt; no value
  xdebug.dump.FILES =&gt; no value =&gt; no value
  xdebug.dump.GET =&gt; no value =&gt; no value
  xdebug.dump.POST =&gt; no value =&gt; no value
  xdebug.dump.REQUEST =&gt; no value =&gt; no value
  xdebug.dump.SERVER =&gt; no value =&gt; no value
  xdebug.dump.SESSION =&gt; no value =&gt; no value
  xdebug.dump_globals =&gt; On =&gt; On
  xdebug.dump_once =&gt; On =&gt; On
  xdebug.dump_undefined =&gt; Off =&gt; Off
  xdebug.extended_info =&gt; On =&gt; On
  xdebug.idekey =&gt; pettermagnusson =&gt; netbeans-xdebug
  xdebug.manual_url =&gt; http://www.php.net =&gt; http://www.php.net
  xdebug.max_nesting_level =&gt; 100 =&gt; 100
  xdebug.profiler_aggregate =&gt; Off =&gt; Off
  xdebug.profiler_append =&gt; Off =&gt; Off
  xdebug.profiler_enable =&gt; Off =&gt; Off
  xdebug.profiler_enable_trigger =&gt; Off =&gt; Off
  xdebug.profiler_output_dir =&gt; /tmp =&gt; /tmp
  xdebug.profiler_output_name =&gt; cachegrind.out.%p =&gt; cachegrind.out.%p
  xdebug.remote_autostart =&gt; Off =&gt; Off
  xdebug.remote_enable =&gt; On =&gt; On
  xdebug.remote_handler =&gt; dbgp =&gt; dbgp
  xdebug.remote_host =&gt; 127.0.0.1 =&gt; 127.0.0.1
  xdebug.remote_log =&gt; /tmp/xdebug.log =&gt; /tmp/xdebug.log
  xdebug.remote_mode =&gt; req =&gt; req
  xdebug.remote_port =&gt; 9000 =&gt; 9000
  xdebug.show_exception_trace =&gt; Off =&gt; Off
  xdebug.show_local_vars =&gt; Off =&gt; Off
  xdebug.show_mem_delta =&gt; Off =&gt; Off
  xdebug.trace_format =&gt; 0 =&gt; 0
  xdebug.trace_options =&gt; 0 =&gt; 0
  xdebug.trace_output_dir =&gt; /tmp =&gt; /tmp
  xdebug.trace_output_name =&gt; trace.%c =&gt; trace.%c
  xdebug.var_display_max_children =&gt; 128 =&gt; 128
  xdebug.var_display_max_data =&gt; 512 =&gt; 512
  xdebug.var_display_max_depth =&gt; 3 =&gt; 3
  </code></pre>
  
  <p>Rgds
  PM</p>