FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

SOLVED: xdebug break on index.php OK, any other .php breakpoint not work

 
Post new topic   Reply to topic    NetBeans Forums -> PHP Users
View previous topic :: View next topic  
Author Message
AGeorge



Joined: 25 Jun 2009
Posts: 8

PostPosted: Thu Oct 29, 2009 7:32 am    Post subject: SOLVED: xdebug break on index.php OK, any other .php breakpoint not work Reply with quote

Hi 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.

Any advice appreciated. PHP ver 5.2.10 Xdebug php_xdebug-2.0.5-5.2.dll Firefox 3.5, Netbeans extn, Firebug 1.4.3

Tks kindly. Al.
PS I fear that this may not be able to be fixed:
http://forums.netbeans.org/ptopic9043.html[/url]


Last edited by AGeorge on Mon Nov 09, 2009 2:17 am; edited 1 time in total
Back to top
View user's profile Send private message
zyanho



Joined: 28 Oct 2009
Posts: 6

PostPosted: Thu Oct 29, 2009 8:33 am    Post subject: Reply with quote

My English is not good enough.but I hope I could do something for you.
I can not get you.

If I got it right .i test it look like

other.php
Code:

$test1 = "other test1";
require_once 'index.php';
$test2 = "other test2";


index.php
Code:

$test1 = "index test1";
$test2 = "index test2";


i set breakpoint other.php at other test1 line ,index.php at index test1 line.and then debug the file other.php. it stop on $test1 = "other test1".when it step into require_once 'index.php' .it also jump in index.php and stop on $test1 = "index test1" .and the end it also re-enters other.php and stop on $test2 = "other test2".it looks ok.

so paste your code plz

btw my php ver 5.3.0 xdebug 2.0.5 netbeans 6.7.1
Back to top
View user's profile Send private message
AGeorge



Joined: 25 Jun 2009
Posts: 8

PostPosted: Thu Oct 29, 2009 8:15 pm    Post subject: Reply with quote

Hi thanks for your valued reply. Unfortunately, I am trying to debug other file so system starts on index.php debug other file is not possible but debug index.php is. It is a known problem with Netbeans for a long time and seems nobody has bothered to fix it up. I think maybe my best solution is to move to Eclipse IDE which does not have this problem, but am happy to try anything else.

Tried IDE Netbeans 6.8 beta, which still does not have PHP debug on anything outside of index.php. I hope its an error of mine that someone can correct me on, because in the past for single PHP files, Netbeans has been great for me.

BTW this debug problem was recognised way back in Oct 2008 for crying out loud.
http://blogs.sun.com/netbeansphp/entry/how_to_create_project_for
Back to top
View user's profile Send private message
zyanho



Joined: 28 Oct 2009
Posts: 6

PostPosted: Fri Oct 30, 2009 8:41 am    Post subject: Reply with quote

the default debug page is index.php
but you can debug what page you want
on the tool bar
you can choose debug->debug file(ctrl+shift+F5)
then it will not starts on index.php and you can debug other page
Back to top
View user's profile Send private message
AGeorge



Joined: 25 Jun 2009
Posts: 8

PostPosted: Fri Oct 30, 2009 10:29 pm    Post subject: Reply with quote

zyanho wrote:
the default debug page is index.php
but you can debug what page you want
on the tool bar
you can choose debug->debug file(ctrl+shift+F5)
then it will not starts on index.php and you can debug other page

Hi Im not sure if this is going to be any use. For example, the default page is index.php, the page I want to debug cannot be instantiated on its own, as its reliant on other pages initializing variables. Maybe there is a way to start debugging after the script is running, but I doubt it.
I've reported this as a bug, and in the meantime am using Eclipse which works, but I dont like it as much.
By the way, Netbeans does not seem to have any problems debugging code as long as its all in the same directory. My other web pages it debugs no problem, its only with Joomla and the like where there is complex directory structure that Netbeans fails.
Cheers, Al.
Back to top
View user's profile Send private message
radek matous
Posted via mailing list.





PostPosted: Mon Nov 02, 2009 8:26 am    Post subject: xdebug break on index.php OK, any other .php breakpoint not work Reply with quote

AGeorge wrote:
Quote:
Hi 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. 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.



Any advice appreciated. PHP ver 5.2.10 Xdebug php_xdebug-2.0.5-5.2.dll Firefox 3.5, Netbeans extn, Firebug 1.4.3



Tks kindly. Al.










Hi,

should work, I think.

You can see:
http://blogs.sun.com/netbeansphp/entry/path_mapping_in_php_debugger

Enable logging and send me the logs :
http://wiki.netbeans.org/HowToConfigureXDebug#section-HowToConfigureXDebug-EnableXdebugLogging

thanks
Radek
Back to top
AGeorge



Joined: 25 Jun 2009
Posts: 8

PostPosted: Mon Nov 02, 2009 10:34 pm    Post subject: Reply with quote

As per OP, the web server is local filesystem.
Using the method you describe unfortunately does not help.
Eclipse still debugs fine, but Netbeans only debugs index.php.
Here is the log:
Log opened at 2009-11-02 22:31:09
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///G:/dev/internet/EasyPHP/www/joomla/administrator/index.php" language="PHP" protocol_version="1.0" appid="1508" idekey="netbeans-xdebug"><engine version="2.0.5"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2009 by Derick Rethans]]></copyright></init>

<- feature_set -i 64 -n show_hidden -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="64" feature="show_hidden" success="1"></response>

<- feature_set -i 65 -n max_depth -v 3
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="65" feature="max_depth" success="1"></response>

<- feature_set -i 66 -n max_children -v 31
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="66" feature="max_children" success="1"></response>

<- feature_get -i 67 -n max_data
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="67" feature_name="max_data" supported="1"><![CDATA[1024]]></response>

<- breakpoint_set -i 68 -t line -s enabled -f file:///G:/dev/internet/EasyPHP/www/thehome/feedback.php -n 62
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="68" state="enabled" id="15080001"></response>

<- breakpoint_set -i 69 -t line -s enabled -f file:///G:/dev/internet/EasyPHP/www/thehome/feedback.php -n 3
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="69" state="enabled" id="15080002"></response>

<- breakpoint_set -i 70 -t line -s enabled -f file:///G:/dev/internet/EasyPHP/www/thehome/feedback.php -n 68
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="70" state="enabled" id="15080003"></response>

<- breakpoint_set -i 71 -t line -s enabled -f file:///G:/dev/internet/EasyPHP/www/joomla/administrator/administrator/components/com_rentalot/admin.rentalot.php -n 888
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="71" state="enabled" id="15080004"></response>

<- run -i 72
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="72" status="stopping" reason="ok"></response>

Log closed at 2009-11-02 22:31:10
Back to top
View user's profile Send private message
AGeorge



Joined: 25 Jun 2009
Posts: 8

PostPosted: Mon Nov 09, 2009 2:16 am    Post subject: When using Netbeans for localhost debug only Reply with quote

Solved by me who caused an error in setup:
In your mysql settings, if there is a home url, make sure its set on localhost, not www.myurl.com. I only noticed this today that when going from localhost/index.php which was being debugged correctly, to another url eg admin.php, the url changed to my www one.
Error can be introduced when you have both localhost and remote versions and same database, typically by backing up and restoring from one to the other. Thank goodness; I was really missing netbeans after using eclipse.
Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> PHP Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB