Yii Framework Forum: How do you debug yii-applications? - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

How do you debug yii-applications? Rate Topic: -----

#1 User is offline   MiR 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 04-February 09

Posted 07 April 2009 - 04:46 AM

For me, it's very helpful to debug code in order to understand the inner workings.

Currently I am using Eclipse PDT and xdebug for my debugging purposes but I am asking myself if there is a better IDE/solution for debugging. Which tools do you guys use?

Thanks in advance,

Michael
0

#2 User is offline   thomas.mery 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 107
  • Joined: 04-January 09

Posted 07 April 2009 - 07:08 AM

hi

PDT + xdebug

works well for me

:)
0

#3 User is offline   phreak 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 79
  • Joined: 19-February 09

Posted 07 April 2009 - 01:49 PM

NuSphere PhpED for Windows.
0

#4 User is offline   Paul Apostol 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 61
  • Joined: 25-March 09

Posted 01 July 2009 - 02:12 PM

Hello,
I'm trying with PDT and XDebug an I just could stop at the first line of index.php
How did you configure your PHP/PDT etc for debugging?
Thank you,
Paul
0

#5 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 01 July 2009 - 11:57 PM

NetBeans + xdebug
0

#6 User is offline   MiR 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 04-February 09

Posted 02 July 2009 - 05:11 AM

Here's a good tutorial on configuring pdt + php:

http://robsnotebook....gger_pdt_xdebug

I've now switched to Netbeans, never liked the 'perspectives' in Eclipse and Netbeans 6.7 is as good as Eclipse for debugging.

There's one last odd problem when debugging, not all contents of variables are displayed but it's quite complex to strip down the problem to the root cause..   
0

#7 User is offline   Paul Apostol 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 61
  • Joined: 25-March 09

Posted 02 July 2009 - 05:53 AM

Thanks,
I already tried that. I fact debugging on scripts works on PDT.
Just with Yii the debugger doesn't stop at breakpoints.
Paul
0

#8 User is offline   MiR 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 04-February 09

Posted 02 July 2009 - 06:00 AM

Please send me the xdebug-part of your php.ini file (On Unix-Systems this is usually an extra file named xdebug.ini), perhaps I am able to see a configuration problem.

Michael
0

#9 User is offline   kk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 37
  • Joined: 01-July 09

Posted 02 July 2009 - 08:25 AM

i am using netbeans for creating Yii applications

but when i insert break point in the file(any) in the application
and when i start the debugger in netbeans it donot stop at the specified point where i inserted the breakpoint

what should i do
please help..


0

#10 User is offline   abajja 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 108
  • Joined: 05-March 09
  • Location:Barcelona, Spain

Posted 02 July 2009 - 08:36 AM

@kk
Which version do you use?
0

#11 User is offline   MiR 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 04-February 09

Posted 02 July 2009 - 08:42 AM

This sounds as if your xdebug settings are not correct, the xdebug running in your webserver-instance calls back the ide when a breakpoint is reached. For this to work correctly xdebug must know on which ip address it can find the ide.

Please Check the following entries in your xdebug.ini or xdebug section of php.ini:

xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = localhost
xdebug.remote_port = 9000

When ide and your web server are running on the same machine then xdebug.remote_host = localhost is correct. If your webserver runs on another machine the you need to replace 'localhost' with the ip or the dns-resolvable name of your machine. You also need to make sure that port 9000 is opend for incoming tcp connections on your machine that hosts the IDE.

Detailed information for netbeans may be found here:

http://www.netbeans....d-software.html
0

#12 User is offline   kk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 37
  • Joined: 01-July 09

Posted 02 July 2009 - 08:48 AM

i use net beans v6.5
0

#13 User is offline   MiR 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 04-February 09

Posted 02 July 2009 - 08:52 AM

If possible, upgrade to 6.7, in 6.5 you will not be able to look into the data of your activerecords
0

#14 User is offline   abajja 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 108
  • Joined: 05-March 09
  • Location:Barcelona, Spain

Posted 02 July 2009 - 09:10 AM

@kk
It should work
1. If you receive an error message saying something like the port 9000 is occupied (or so ...) then Follow what MiR suggested. This is surely due to a misconfiguration
1. if not go to Tools/options/php and activate Stop at First Line if it is not already activated. Or just make a breakpoint in index.php and see what happens.
0

#15 User is offline   kk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 37
  • Joined: 01-July 09

Posted 02 July 2009 - 09:19 AM

it was already checked in the box

when i right click on the project and click debug

it asks

debug projects sources

server side PHP

server side PHP with client side java script in the selected browser

which one should i select
0

#16 User is offline   abajja 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 108
  • Joined: 05-March 09
  • Location:Barcelona, Spain

Posted 02 July 2009 - 09:23 AM

Just go with
Server side PHP
0

#17 User is offline   MiR 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 04-February 09

Posted 02 July 2009 - 09:24 AM

Depends on what you want to do ;-)

If you want to simply debug a script written in php choose the first option, if you want to debug a complex yii aplication the second option is your friend.

Please reads the documentation from netbeans.org I proposed a few posts before, this should answer most, if not all of your questions.



0

#18 User is offline   Paul Apostol 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 61
  • Joined: 25-March 09

Posted 02 July 2009 - 10:52 AM

Thank you for information.
My server config for debug was wrong. Now it's working fine.
Paul
0

#19 User is offline   dimis283 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 277
  • Joined: 24-January 09

Posted 02 July 2009 - 12:38 PM

Quote

If possible, upgrade to 6.7, in 6.5 you will not be able to look into the data of your activerecords

What do you mean with data?
I just make the debuging with 6.5 and I see the "$model" objects of my site,even I did not see the values of each model (title etc)
0

#20 User is offline   MiR 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 04-February 09

Posted 02 July 2009 - 12:45 PM

Yii declares a lot of variables in it's classes as private, with version 6.5 they are invisible to the debugger, starting with Version 6.7 you can see much more private vars, but still not all.
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users