Why is CakePHP interpreting my XDEBUG QUERY_STRING as a route?

Why is CakePHP interpreting my XDEBUG QUERY_STRING as a route?

Context:
This is a CakePHP Eclipse Xdebug Configuration ProblemI while using WINDOWS 10, Eclipse, XAMPP, XDEBUG. I have configured Eclipse to use XDEBUG and it is finding the webroot/index.php via mod_rewrite rule in .htaccess file.

My URL:
hxxp://localhost/myproject/index.php?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=123…
$_SERVER[REQUEST_URI] = ‘/myproject/index.php?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=123…’

Result:
Missing Route Cake\Routing\Exception\MissingRouteException
Error: A route matching “XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY…” could not be found.

Debug Configuration:
File: /myproject/webroot/index.php
URL: hxxp://localhost/myproject/index.php

Apache:
DocumentRoot: C:\xampp\htdocs

Eclipse Include Paths (are same as Build Paths):
myproject/src
myproject/vendor (with an exclusion for the one below…)
myproject/vendor/cakephp/cakephp/src

Observation:
When I step through the index.php code.
(1) __DIR__ resolves to “C:\xampp\htdocs\myproject\webroot”, and this would seem to lead to line index.php, line 31, requiring C:\xampp\htdocs\myproject\webroot\config\bootstrap.php, but the path should be without the “\webroot” part.

require dirname(__DIR__) . ‘/config/bootstrap.php’;

(2) Eclipse shows warnings like, “The import Cake\Network\Request cannot be resolved.” (So my Include Paths and Build Path might not be set properly.".

WORKAROUND Found:
Avoid using the debug launch from within Eclipse; Use instead, Remote Debug Launch using web browser plugin. I am using Firefox “Xdebug helper” Add-on. This does the right thing.

FWIW, I’m getting exactly the same error with netbeans, which didn’t happen on 2.10. Can you elaborate on how you get Firefox to start with the debugger? I have the “Xdebug helper” Add-on for Firefox but can’t get breakpoints to work. Thanks.
Meanwhile if anyone knows how to fix this properly…

I twigged it for netbeans.

Right clicked on Project & selected Run Configuration…
Index File was “index.php”.
Changed Index File to “webroot/index.php”.
Can now fire up the app from Netbeans and breakpoints work.
Presumably something similar can be done for Eclipse.

Thank you peterg, I could not have the xdebug correctly set up for my NetBeans project, your hint solved my issue