javadecaf Reply #1, 10 months, 3 weeks ago
I'm hoping there's someone else out there who has run into this issue in NetBeans, but it may apply to other IDE's as well. I have created a custom manager page per the tutorial and I'm having some trouble with it. For testing purposes, I trimmed index.php down to just 2 lines of code:
I set a breakpoint on the first line, and fire up my debugger (xDebug, which works great on front-end pages). Usually, a green arrow would pop up on the breakpoint, but on this page, I get no green arrow, and no indication of what line will execute next. The only way I can tell where I am is to look at the call stack, which gives the current function as "core/components/mycmp/index.php.{main}:29]".
Does anyone understand this syntax? My index.php has only 2 lines - why is it referring to line 29? (Incidentally, it has started on that number every time, even before I reduced the file to 2 lines). What does {main} refer to? And why is my breakpoint not working? I can hit F5 until the page loads completely in the browser, and the result is as expected ("Houston, we have a problem" is displayed on the screen) but execution never halts on breakpoint.
Can anybody help me out here?
(BTW, on forum posts, I know the syntax for code and PHP syntax highlighting, but I can't seem to combine the two. Does anyone know how to do that?)
$output = "Houston, we have a problem."; return $output;
I set a breakpoint on the first line, and fire up my debugger (xDebug, which works great on front-end pages). Usually, a green arrow would pop up on the breakpoint, but on this page, I get no green arrow, and no indication of what line will execute next. The only way I can tell where I am is to look at the call stack, which gives the current function as "core/components/mycmp/index.php.{main}:29]".
Does anyone understand this syntax? My index.php has only 2 lines - why is it referring to line 29? (Incidentally, it has started on that number every time, even before I reduced the file to 2 lines). What does {main} refer to? And why is my breakpoint not working? I can hit F5 until the page loads completely in the browser, and the result is as expected ("Houston, we have a problem" is displayed on the screen) but execution never halts on breakpoint.
Can anybody help me out here?
(BTW, on forum posts, I know the syntax for code and PHP syntax highlighting, but I can't seem to combine the two. Does anyone know how to do that?)
I finally found the solution (with some help from robinK via PM). I probably should have mentioned in the initial post that I'm using remote debugging, my IDE being on a different machine from my local webserver. In NetBeans, this may (and in my case, does) require that you specify Path Mapping for the project, so it knows where to find the files for debugging. To do this, go to Project Properties -> Run Configuration -> Advanced, enter the server path for your project (e.g. /var/www/mywebsite.com) and click the little gray button to navigate to the project folder (e.g., \\mywebserver\mywebsite.com). Save your configuration, and everything should work together nicely.