2026 Community Survey results are here! See how the Craft CMS community works. results are live!

What is Xdebug, anyway?

Settle in as Ryan explains what Xdebug is at how it works with your IDE and DDEV.

Xde­bug is a PHP exten­sion that pro­vides step debug­ging with IDE inte­gra­tion. It lets you pause code exe­cu­tion at any line, inspect vari­ables, and step through your code to under­stand exact­ly what’s hap­pen­ing at runtime.

Unlike var_dump() debug­ging, Xde­bug shows you the full exe­cu­tion con­text: call stacks, vari­able states, and exe­cu­tion paths. It’s the dif­fer­ence between guess­ing and knowing.

Xdebug’s capa­bil­i­ties:

  • Step debug­ging: Pause exe­cu­tion any­where, inspect every­thing, step through line by line
  • Pro­fil­ing: Iden­ti­fy per­for­mance bot­tle­necks with func­tion-lev­el tim­ing data
  • Stack traces: See full vari­able con­text when errors occur, not just line numbers
  • Code cov­er­age: Ver­i­fy which code your tests actu­al­ly execute
  • Func­tion traces: Record all func­tion calls for debug­ging inter­mit­tent issues

This course focus­es on step debug­ging – the fea­ture you’ll use dai­ly. We’ll cov­er pro­fil­ing in the bonus sec­tion for those inter­est­ed in per­for­mance optimization.

Craft Version
Craft 4, Craft 5
Instructor
Level
Intermediate
Date Published
December 10, 2025