title: xdebug not talking to Eclipse debugger
body: <p>I'm trying to get Eclipse to talk to xdebug. From the xdebug log, it seems that xdebug is working correctly (i.e.: it's sending it's <code>&lt;init&gt;</code> and <code>&lt;response&gt;</code> messages), but Eclipse is not sending anything to xdebug (i.e.: no <code>feature_set</code>, <code>feature_get</code>, etc. commands like Netbeans).</p>
  
  <hr>
  
  <p>Here's my setup:</p>
  
  <ul>
  <li>Mac OS/X 10.7.5</li>
  <li>Eclipse 4.2.1 "Juno"
  <ul>
  <li>PHP Development Tools (PDT) SDK Feature 3.1.1.201209101312</li>
  </ul></li>
  <li>(Netbeans 7.1.2)</li>
  <li>MAMP 2.1.1 running:
  <ul>
  <li>apache 2.2.22</li>
  <li>PHP 5.4.4
  <ul>
  <li>the PHP executable being run is <code>/Applications/MAMP/bin/php/php5.4.4/bin/php</code></li>
  <li>the PHP config file being used is <code>/Applications/MAMP/bin/php/php5.4.4/conf/php.ini</code></li>
  <li>xdebug 2.2.0</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>The relevant lines from my <code>php.ini</code> are:</p>
  
  <pre><code>[xdebug]
  zend_extension = "/Applications/MAMP/bin/php/php5.4.4/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
  xdebug.default_enable = on
  xdebug.remote_enable = on
  xdebug.remote_host = localhost
  xdebug.remote_port = 9000
  xdebug.remote_autostart = on
  xdebug.remote_handler = "dbgp"
  xdebug.remote_autostart = on
  xdebug.remote_mode = "req"
  xdebug.remote_connect_back = on
  xdebug.remote_log = /tmp/xdebuglog.log
  </code></pre>
  
  <hr>
  
  <p>I can get Netbeans to connect to xdebug on port 9000 with session ID <code>netbeans-xdebug</code> with no problem. Note that when I start debugging, it opens a new window in my web browser with <code>?XDEBUG_SESSION_START=netbeans-xdebug</code> appended to the URL of the PHP file I'm running.</p>
  
  <p>Here is a snippet from the xdebug log when Netbeans tries to connect:</p>
  
  <pre><code>Log opened at 2013-01-18 18:42:52
  I: Checking remote connect back address.
  I: Remote address found, connecting to ::1:9000.
  I: Connected to client. :-)
  -&gt; &lt;init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Applications/MAMP/htdocs/projectname/index.php" language="PHP" protocol_version="1.0" appid="647" idekey="netbeans-xdebug"&gt;&lt;engine version="2.2.0"&gt;&lt;![CDATA[Xdebug]]&gt;&lt;/engine&gt;&lt;author&gt;&lt;![CDATA[Derick Rethans]]&gt;&lt;/author&gt;&lt;url&gt;&lt;![CDATA[http://xdebug.org]]&gt;&lt;/url&gt;&lt;copyright&gt;&lt;![CDATA[Copyright (c) 2002-2012 by Derick Rethans]]&gt;&lt;/copyright&gt;&lt;/init&gt;
  
  &lt;- feature_set -i 0 -n show_hidden -v 1
  -&gt; &lt;response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="0" feature="show_hidden" success="1"&gt;&lt;/response&gt;
  
  &lt;- feature_set -i 1 -n max_depth -v 3
  -&gt; &lt;response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="max_depth" success="1"&gt;&lt;/response&gt;
  
  &lt;- feature_set -i 2 -n max_children -v 30
  -&gt; &lt;response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_children" success="1"&gt;&lt;/response&gt;
  
  &lt;- feature_get -i 3 -n max_data
  -&gt; &lt;response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="3" feature_name="max_data" supported="1"&gt;&lt;![CDATA[1024]]&gt;&lt;/response&gt;
  
  &lt;- stdout -i 4 -c 1
  -&gt; &lt;response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stdout" transaction_id="4" success="1"&gt;&lt;/response&gt;
  
  &lt;- step_into -i 5
  -&gt; &lt;response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="5" status="break" reason="ok"&gt;&lt;xdebug:message filename="file:///Applications/MAMP/htdocs/projectname/index.php" lineno="17"&gt;&lt;/xdebug:message&gt;&lt;/response&gt;
  
  &lt;- stack_get -i 6
  -&gt; &lt;response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="6"&gt;&lt;stack where="{main}" level="0" type="file" filename="file:///Applications/MAMP/htdocs/projectname/index.php" lineno="17"&gt;&lt;/stack&gt;&lt;/response&gt;
  
  …
  
  -&gt; &lt;response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="14" status="stopping" reason="ok"&gt;&lt;/response&gt;
  
  Log closed at 2013-01-18 18:47:21
  </code></pre>
  
  <hr>
  
  <p>In Eclipse…</p>
  
  <p>I created a new PHP Project in the workspace, using the default PHP settings, and created separate folders for source files and public resources. I changed nothing in the PHP Include Path step, but in the PHP Build Path, I clicked <code>Link Source</code> and linked <code>/Applications/MAMP/htdocs/projectname</code> with a <code>projectname</code> folder in my project.</p>
  
  <p>I then set Eclipse preferences as follows:</p>
  
  <ul>
  <li>In <code>General</code> -> <code>Web Browser</code>, I've set it to use an external web browser (Firefox).</li>
  <li>In <code>PHP</code> -> <code>Debug</code> -> <code>Installed Debuggers</code>, I've checked that XDebug is in the list, is using port 9000, JIT remote sessions are off, and I used <a href="http://objitsu.com/content/eclipse-pdt-and-xdebug-working-together-last" rel="nofollow">these instructions to ensure it uses the idekey <code>mparker17</code></a>.</li>
  <li>In <code>PHP</code> -> <code>Debug</code>, I:
  <ul>
  <li>Set the PHP Debugger to "XDebug"</li>
  <li>Set the PHP Server to the correct base URL (<code>http://projectname.local</code>) local web root (<code>/Applications/MAMP/htdocs/projectname</code>) and path mapping between the server and my workspace.</li>
  <li>Set the PHP Executable to the correct executable path (<code>/Applications/MAMP/bin/php/php5.4.4/bin/php</code>), PHP ini file (<code>/Applications/MAMP/bin/php/php5.4.4/conf/php.ini</code>), the SAPI type to "CLI" and the PHP debugger to "XDebug".</li>
  <li>Checked the <code>Enable CLI Debug</code> checkbox.</li>
  <li>Checked the <code>Break at first line</code> checkbox.</li>
  </ul></li>
  </ul>
  
  <p>In my debug configurations, I added a PHP Web Application and set it's preferences as follows:</p>
  
  <ul>
  <li>In the <code>Server</code> tab I set the PHP server created above, set the file correctly, and set the URL correctly. </li>
  </ul>
  
  <p>Here is a snippet from the xdebug log when Eclipse tries to connect:</p>
  
  <pre><code>Log opened at 2013-01-18 17:33:48
  I: Checking remote connect back address.
  I: Remote address found, connecting to ::1:9000.
  I: Connected to client. :-)
  -&gt; &lt;init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Applications/MAMP/htdocs/projectname/index.php" language="PHP" protocol_version="1.0" appid="703" idekey="mparker17"&gt;&lt;engine version="2.2.0"&gt;&lt;![CDATA[Xdebug]]&gt;&lt;/engine&gt;&lt;author&gt;&lt;![CDATA[Derick Rethans]]&gt;&lt;/author&gt;&lt;url&gt;&lt;![CDATA[http://xdebug.org]]&gt;&lt;/url&gt;&lt;copyright&gt;&lt;![CDATA[Copyright (c) 2002-2012 by Derick Rethans]]&gt;&lt;/copyright&gt;&lt;/init&gt;
  
  -&gt; &lt;response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"&gt;&lt;/response&gt;
  
  Log closed at 2013-01-18 17:33:49
  </code></pre>
  
  <hr>
  
  <p>This seems to indicate to me that Eclipse isn't talking to xdebug, but I'm stumped as to <em>why</em> that would be happening.</p>