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.