Xdebug with Zero Configuration

benjifisher

When something goes wrong—or even when things are going right, and you want to understand how they work—running your code through a debugger is the way to go. It is also a lot of fun!

The standard debugger for PHP code is Xdebug. Many developers are put off by the process of setting it up:

  • Install a version of PHP with Xdebug compiled in.
  • Muck around with configuration files on the server.
  • Configure the IDE to work with Xdebug.
  • Synchronize files between the IDE and the server.

As a result, too many of us put off getting started with Xdebug. Then a day comes when we really need it, and that is the worst time to start looking for blog posts on how to set it up.

This session will show you how to get Xdebug up and running, reliably and with zero configuration. The trick is to set up a virtual machine (VM) running PHP with Xdebug and an IDE. That way, all the configuration can be done on the VM and it can all be automated.

Here are the tools we pull together:

  • VirtualBox or Parallels or VMware
  • Vagrant
  • Ansible
  • PHP and Xdebug
  • Vim and the Vdebug plugin

Who should attend this session:

  • Developers (meaning anyone who has written PHP code)
  • DevOps experts and wannabes

What you will learn:

  • How to set up Xdebug
  • How to step through code
  • Conditional breakpoints are your friend

Session Track

Coding and Development

Experience Level

Intermediate

Drupal Version