3

I'm having trouble with a PHP project using Yii framework. My setup is the following: Win7 + Eclipse4.2 + PDT 3.1 + Yiiclipse PDT extension + WAMP Server with XDEBUG enabled.

Pretty much everything works ok. The debug session starts, it's going through project's index.php source, but when it has to jump to framework's files, it doesn't open them up. I edited source lookup and added framework's local path but it simply cannot find them.

Here is a screenshot: http://img607.imageshack.us/img607/3687/eclipsepdt.png

http://img607.imageshack.us/img607/3687/eclipsepdt.png

topher
  • 14,790
  • 7
  • 54
  • 70
klaudyuxxx
  • 374
  • 2
  • 13
  • 1
    Have you tried with some simple project to check if it works? Ensure first if it is Yii specific problem, or some eclipse misconfiguration. –  Feb 12 '13 at 08:58

2 Answers2

0

This isn't necessarily an answer - but your question isn't necessarily a question either, so I feel like this is fair game :D

I've had so many problems with Eclipse PDT + xdebug in the past with debugging, code completion, etc., that I gave up on it a while ago and switched to Netbeans for PHP Debugging. It's now the defacto standard on my development team for debugging PHP; even though we all still have our own favorite editors, when we need to debug we'll still use Netbeans.

Code completion, phpdoc 'tooltips' on completion, and debugging all work flawlessly for me regardless of what platform I'm developing on (Windows, OS X, Linux) and I cannot say the same about Eclipse PDT (code completion would often miss, I'd run into problems or crashes debugging,etc.) in my personal experience.

So, I apologize in advance if this is a non-answer to a non-question - but maybe try out Netbeans?

AndrewPK
  • 6,100
  • 3
  • 32
  • 36
  • 1
    Netbeans is know to work bit better with Xdebug than Eclipse, but it is for sure much slower in current version (7.x) than Eclipse. And from version to version (7.2) it becomes slower and slower. I've been using Eclipse about three years ago and it was awfully slow, so I switched to Netbeans, which was quite fast at that time. Then they introduced version 7 with a famous "_slowness detector_" and from version to version it become slower and slower. When it reached critical point of spending 10 seconds on opening small file on dual-CPU and 4 GB or RAM, I dropped it, going back to Eclipse again. – trejder May 15 '13 at 12:37
0

Are you sure, you can use Xdebug to debug Yii (or any other framework-based) applications at all? Since Yii introduces URL-rewriting based on MVC pattern, I think you can't.

I don't have much experience with Xdebug, but from what I have found I clearly see, that it (along with Eclipse PDT) strongly depends on URL shown in Eclipse's internal browser, when debugging.

So, taking for example an URL from your screenshot:

http://localhost/testdrive/index.php?r=dispozitive

As you mentioned, Eclipse has correctly opened index.php, which is normal, as it is directly referenced in URL and you problably pointed it out as start file in debug configuration window.

Buth going further. How would you like Eclipse to understand, that route dispozitive (where route itself is a completely Yii concept (or similar framework) and Eclipse / Xdebug / PHP knows nothing about it) or that ?r=dispozitive URL parts corresponds to executing protected/SiteController.php file in your file system and calling default actionIndex() from it? So it could know it should open it in IDE and possibly stop execution on there defined breakpoints.

This process and concept (routing) is 100% authored by Yii and done by it internally, so how would you like Eclipse or Xdebug to know anything about it?

As I wrote, I don't have much experience in debugging Yii applications, but from what I have found until know, I clearly see, that you can't debug PHP applications with Xdebug, if they are using any kind of URL-rewriting methods. This technique (debugging with Xdebug) works IMHO only in case of applications, where URL changes directly reflects files in filesystem in your application contents.

EDIT: Additionally, check which version (package) of Eclipse you have? It turns out, that Helios package has some bugs and doesn't stops on breakpoints. Which makes it pretty useless for debugging process. You should consider using Galileo Package Eclipse for PHP Developers instead.

Community
  • 1
  • 1
trejder
  • 17,148
  • 27
  • 124
  • 216