xdebug and Eclipse

xdebug is an immensely powerful tool for exploring what your code really does.

You can get a long way using print_r  but ultimately this always requires that you predict the path your code will take - and the tricky bit about debugging is you need it when your predications have gone wrong.

It's generally pretty easy to set up

  • install the php5-xdebug package
  • check that the Eclipse PHP preferences have xdebug as an option
  • if you're debugging locally the default settings should be OK
  • create a site configuration in the debug dialog
  • set a break point
  • start debugging

If it doesn't work at first restart Eclipse

Check that you have a browser configured in Eclipse

Not all settings seem to be picked up immediately 

Tags

Post new comment

Got something to add - just enter a comment
all other fields are optional.

Your email address will not be published.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.