Skip to content

Xdebug Profiling

Although DDEV has more sophisticated profiling capabilities with xhprof and it also has built-in support for xdebug profiling.

Basic usage

  • Create the directory .ddev/xdebug, which is where the output files will be dumped.
  • Switch XDebug to profiling mode by adding this in .ddev/php/xdebug.ini
  • Enable xdebug with ddev xdebug on
  • Do a HTTP request to the DDEV project and the profile will be located in .ddev/xdebug directory.
  • Analyze it with any call graph viewer, for example kcachegrind.
  • When you're done, execute ddev xdebug off to avoid generating unneeded profile files.

Last update: August 24, 2022