Search

What methods for debugging PHP in Symphony do you use? What is your debug workflow?

It would be great to see what experienced developers have in their toolbox.

I’m using Eclipse PDT with some other add-ons installed (XSL, JS etc). I still haven’t found a way to debug Data Sources, Events and Extensions except guerilla debugging. Is there anyone who’s using Eclipse and the built-in debugger?

For PHP I rely solely on Textmate, a browser, and

var_dump($object);die;

I follow the same method as my colleague mr Nick Dunn, but I find that the following method proudces much more readable output:

http://pastie.org/1540447

This will neatly indent everything, show nested arrays nicely and all that sort of thing.

Basically my way of debugging as well. I switched to using var_dump instead of print_r a while ago too. Some downsides with print_r is that it doesn’t output NULL or FALSE and obscures TRUE as 1. Otherwise the <pre> tip is nice if you don’t want to use “View source” to view the debug output in a readable form.

There is also Xdebug which can override PHPs var_dump() to output nicely indented and highlighted code and also offers other valuable debug information like stack and function traces.

Yeah, I know of Xdebug and Zend debugger. They are both integrated in Eclipse. Too bad I don’t really know how to use them with Symphonys’ structure.

I managed to debug PHP scripts with XDebug in Eclipse PDT on localhost or any other external server. Very useful for extension developers and others. Let me know if you're interested.

Let me know if you're interested

I am.

I'll write a little How To. It will be ready by tomorrow afternoon, I believe. Got to redo the steps so I don't speak crap.

I am too, I never figured out how it all works...

I am XDebug and Webgrind running locally on my Mac, it comes in handy when I'm crunching performance, but I don't use it often for debugging ironically (well apart from formatted var_dump).

I'd be interested to see if it can be used better :)

@brendo

So, at this moment ... you're building Symphony with var_dump()? Amazing ...

I don't use it often for debugging ironically

Brendo's a hipster coder! When he debugs, he only does so ironically.

I'm quite busy today and tomorrow so I'm delaying the How To a bit. Sorry for the delay.

xdebug is the first thing I install on any new development environment. If the code is particularly complex or difficult I'll use MacGDBp, otherwise the xdebug formatted var_dump is just fine and dandy for me.

A small tutorial for setting up Eclipse PDT and XDebug for PHP debugging.

@Forum Admins

Please do not delete this post because the linked resources from the tutorial refer to this comments' attachments. Thanks!

Attachments:
os-php-eclipse-pdt-debug-pdf.pdf, 4.3_example.jpg, 4.2_new_debug_configuration.jpg, 4.1_enter_debug_cofigurations.jpg, 3.2_xdebug_setup_example.JPG and 2.2_create_project.jpg

Tutorial ready. See previous post. Sorry for the delay. Sweet o' vacation :)

I would like to suggest Codelobster PHP Edition

It has great free PHP debugger

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details