How do you debug yii-applications?

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

hi

PDT + xdebug

works well for me

:)

NuSphere PhpED for Windows.

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

NetBeans + xdebug

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…   

Thanks,

I already tried that. I fact debugging on scripts works on PDT.

Just with Yii the debugger doesn't stop at breakpoints.

Paul

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

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…

@kk

Which version do you use?

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

i use net beans v6.5

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

@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

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

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

Just go with

Server side PHP

Depends on what you want to do :wink:

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.

Thank you for information.

My server config for debug was wrong. Now it's working fine.

Paul

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)

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.