Fork me on GitHub

What is Xdebug?

Xdebug is debugger and profiler for PHP. We mainly use it as profiler and it’s installed in the Vagrant box by default.

Profiling pages with Xdebug and webgrind

You can profile any page in Vagrant by visiting them and using ?XDEBUG_PROFILE paramater in the url.

This will generate new dbkg dump which you can the analyze using in your browser using webgrind.

Example: Profile WP admin dashboard

  1. Visit: http://wordpress.local/wp-admin/?XDEBUG_PROFILE
  2. Visit http://webgrind.wordpress.local/
  3. Click update button and wait for webgrind to analyze the dump.
  4. You can see the profiling of the admin page and lookup slow functions which you can optimize.

Xdebug in Vagrant