aPaddedCell Article: Easy PHP Debugging in Ubuntu (using Xdebug and Vim)

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

Here's the article summary:

aPaddedCell wrote: A debugger helps greatly when testing or bug fixing in PHP, when working with complicated code, or fixing difficult problems: a debugger is an invaluable tool. This article shows how to set up a PHP debugger in Ubuntu (tested on both Feisty 7.04 and the upcoming Gutsy 7.10) using Xdebug and Vim. This is aimed at developers who may be good at coding but are not necessarily familiar with GNU+Linux in general, therefore everything is explained simply and step-by-step.

Post any comments, suggestions, questions etc. here. Hope you find the article useful. Smiling

a Padded Cell our articles site!

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

Personally, I would explain how to copy/paste using the keyboard and middle mouse button. I know you were trying to make it easy for everyone, but every programmer should know basic keyboard functions.

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

Quote: I would explain how to copy/paste using the keyboard and middle mouse button.

Good suggestion. I added a note that ctrl-c and ctrl-v can be used just the same as other operating systems. Didn't want to over-explain it or patronise anyone so have kept it short. Smiling

Thanks for that.

a Padded Cell our articles site!

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Well, I think that you shouldn't have to explain how to copy and paste at all. Just say Copy and Paste. Everyone knows how to do that, unless you're a complete and total noob, in which case you shouldn't be attempting to debug PHP in Ubuntu. Or using PHP at all for that matter Wink

Being fussy though - good article Smiling

They have: 1 posts

Joined: Nov 2009

I think you should also include

xdebug.show_exception_trace=on

in your sample config

otherwise, xdebug doesn't display stack traces for uncaught exceptions.

They have: 1 posts

Joined: Nov 2010

There is an alternative xdebug client implementation now using vim-addon-async (but requires client-server): http://github.com/MarcWeber/vim-addon-xdebug. There are no timeouts when the debugger can connect to VIm.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.