How To Use XDebug 3 with XAMPP on Windows

XDebug is a nerdy piece of technology that lacks any user in mind design, and the documentation is mess. But sometimes you might need it for analysing your code processes and the timings it takes for it run. These are some written down notes how to make it work without going through the entire web of articles and how to guides.

  1. Download the xdebug.dll PHP extension and place the file in your PHP extensions folder e.g. c:\xampp\php\ext\xdebug.dll.

  2. Edit your c:\xampp\php\php.ini and add the xdebug configuration to the bottom:

[XDebug]
zend_extension = xdebug
xdebug.mode = profile
xdebug.start_with_request=trigger
xdebug.use_compression = false
xdebug.output_dir = "c:\xampp\tmp\cachegrind"

xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_name = "cachegrind.out.%s"
  1. Open XAMPP Control Panel and restart Apache.

  2. Grab the Chrome extension XDebug Helper for a convenient button to enable Xdebug.

  3. Load your website and use the browser extension to enable Profiler. Cachegrind files should be generated in your folder c:\xampp\tmp\cachegrind when you load your pages.

  4. Install QCachegrind for Windows.

  5. Use QCachegrind to open the cachegrind files for analyzing the PHP process.

Revisions

Recently Edited Articles
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.