views:

89

answers:

3

What is the simplest way to get started with debugging and hit a specific line in a Drupal install?

  1. Generally?
  2. With Eclipse? (how difficult?)
  3. On Windows, knowing and having access to Visual Studio (How Difficult with Visual Studio?)

(No Pay: Free or trial)

Locally on Windows I am using the Acquia Drupal WAMP-stack. On the server Ubuntu/Webmin/LAMP.

+3  A: 

Hi, debugging Drupal is as easy as debugging any PHP application in fact :) there's Visual Studio plugin which adds support for PHP http://www.jcxsoftware.com/ - it is commercial unfortunately.

If you're looking for free solutions working with X-Debug I'd recommend

well hopefully you won't be mad with mebut I'll recommend also my own IDE as well

  • HateML 2 - http://hateml.com/ - not 100% ready yet, but working with projects & debugger is pretty complete. What's important, I've updated it to work with latest XDebug release which broken support for "watches" feature in some old IDEs.

There are also Java-based IDEs (like mentioned Eclipse, or Aptana, NetBeans etc) however I have no experience with them as they consume way too much memory as for me

migajek
I know nothing about XDebug :-)
Olav
The Visual Studio plugin seems to have a 30 day trial, which is good enough for me. More problematic is that the free VS versions are not listed. Also I don't know how well it works with my Apache-stacks.
Olav
XDebug is PHP extension. It should work with any server software capable of running php. Have a look at XDebug website for details of installation (which is pretty simple, you can use pecl install xdebug or use ready binaries if running windows). Configuring for remote debugging is described in specific IDE manual, but in most cases simply setting "remote_enabled = 1" is enough.
migajek
+1  A: 

There's a few tutorials out there on how to setup Eclipse together with Xdebug. It's a great combo that I use myself.

Sometimes for light-weight debugging, I have found the FirePHP plugin to firefox to come really handy.

Industrial
>Sometimes for light-weight debugging, I have found the FirePHP<So that would be the best answer to my question I guess (To get quickly started)
Olav
well FirePHP is not really a debugger, it's kind of logging system ... "Real" debuggers tend to have execution control (breakpoints, step in/out, continue) and ALL variables preview, including expression evaluator.
migajek
I am well aware of that firePHP is suited for logging specific, known variables, but it's really handle to have it available and drop it into an existing app and just call firePHP whenever it's needed to trace specific variables through firefox. 9 out of 10 times in the past I have not needed either breakpoints or any of the other features that xDebug offers, except the possibility of following the changes of a variable throughout execution. If you think that you are in the need of accessing breakpoints, stepping around in code, then you'll definitely need Xdebug as michal said.
Industrial
I see there is also FireDrupal..Anyway it seems you have to change the source, and there is no drupal module doing it, otherwise it sound like a interesting thing, but should compare it to Drupal debug-modules
Olav
Hi! That's true, you need to integrate the firePHP library somewhere. Thats another downside to it. I like to keep it integrated all the time though, it have saved my ass many times :) Here's a link for you. I do not have any drupal knowledge, so I can't tell if it's working or not, but it should get you started: http://www.balancedscale.com/blog/200903/installing-firephp-drupal
Industrial
Found this one as well: http://drupal.org/cvs?commit=113141 - "Put fb.php into the devel directory and you can start calling fb() to log information to firebug." Sounds really easy :)
Industrial
It's kind of var_dump, except that it sends the output to a separate firefox window, isn't it? :)
migajek
+1  A: 

If you're looking for free/os options I would recommend using Eclipse PDT with XDebug.

A good place to start is http://www.eclipse.org/pdt/articles/debugger/os-php-eclipse-pdt-debug-pdf.pdf

Treur