This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 175737 - PHP debug only works on index.php
Summary: PHP debug only works on index.php
Status: RESOLVED WORKSFORME
Alias: None
Product: php
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: PC All
: P3 blocker (vote)
Assignee: rmatous
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-30 05:37 UTC by algeorge
Modified: 2019-03-15 10:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description algeorge 2009-10-30 05:37:50 UTC
I have read elsewhere this is a problem, but with older version than my Netbeans which is 6.7.
I'm trying to debug Joomla extension php files served on localhost, with 'Run as Local Web site' , not Run as Script.
Xdebug is initializing ok, as it will stop on the first line of index.php, but once the ide leaves index.php debug stops
(breakpoints in any other module non-functional) until code re-enters index.php. Maybe losing the project path
information somehow which is http://localhost/joomla1.6/ however, if thats the case I cant for the life of me see where.
PHP ver 5.2.10 Xdebug php_xdebug-2.0.5-5.2.dll Firefox 3.5, Netbeans extn, Firebug 1.4.3 
BTW this debug problem was recognised way back in Oct 2008!! and has been mentioned many times elsewhere.
Comment 1 algeorge 2009-10-30 09:24:11 UTC
Using same source code with Eclipse, no problems with debug.
Using Netbeans and another project with all files in root directory, debug worked appropriately in all .php files. 
Original project has files below root. This may not be the cause, but is an indicator.
Al.
Comment 2 miked_187 2009-11-18 12:34:19 UTC
debugging PHP in NB leaves a lot to be desired, but there is a hacky workaround for this problem that I've been using (while I continue to wish for a better debug environment...) - here is how I do it:

assume that you have xdebug installed on your local apache instance, and that a phpinfo() shows xdebug as part of the splash area under the first section of variables as shown here:  http://eboraks.com/wp-content/uploads/2009/07/php_info.jpg


Tools|Options|PHP

in the debugger section :
port 9000
session id = netbeans-xdebug
checkbox for stop at first line = on

open up index.php, hit ctrl-f5 to launch debugger, netbeans debugger is now alive and listening on port 9000.  

press the green arrow (f5) in the debugger toolbar to run the code to the end.  debugger is still alive and listening at this point, just not actively debugging.

in another browser window enter the joomla url on your local apache instance you want debug but add :

&XDEBUG_SESSION_START=netbeans-xdebug

to the end of the URL, this will send the debugging output to NB which is still listening on 9000

lay your breakpoint in where ever you want/need and either step or run to that point.

the key is to launch the NB debugger and leave it in a listening mode so that it will light up when you launch your own url with the extra param noted above.

a quick pimp/shoutout for using the DBGP plugin for notepad++ when debugging PHP code, the guy who developed this NP++ plugin got it right, if this exact debugging functionality was available in NB it would make NB the must-have app for PHP development.  debugging php in nb is gruesome at best.
Comment 3 algeorge 2009-11-18 13:01:13 UTC
FIXED no fault of Netbeans.
Thanks for info. In fact, it was eventually sorted by me, but was not NB fault really :-(
What turned out to be happening, index.php was working within localhost on local PC, but any other php file was url to external eg internet site, so it could not continue debug - very embarrassing.
Comment 4 rmatous 2010-06-08 10:38:01 UTC
works for me
Comment 5 Thanos1234 2019-03-15 10:10:04 UTC
Thanks for the given this post here looking here https://solitaire-klondike.net and join the amazing free online klondike solitaire games for the more enjoyments forever.