This session guides you how to detect and debug PHP scripts with the free open source tool Xdebug, which is an extension to PHP. During this interactive session we’ll be looking at a flawed application and use Xdebug to find bugs in it. It will be fun to do, and there will be prizes! The application will be distributed as a VirtualBox image, so please have that installed.
Questions & Answers
Who’s the target audience for this tutorial?
Everybody that uses PHP and wants to know how to effectively debug their code.
How experienced do I need to be?
You need to be quite familiar with PHP, but no need to be a star at it. OO knowledge is however necessary.
Which version of software / php etc will you be covering?
I will be covering PHP 5.3/5.4 with Xdebug 2.2 and some other small tools.
Do I need to bring a laptop?
Yes, you need to have a laptop with a working PHP environment and IDE.
Do I need to install or set-up any specific software prior to the day, in order to get the most out of the day?
- Preferably you have a Linux machine, or atleast a Linux VM
- PHP 5.3 or PHP 5.4 installed, with the “php” and “pecl” tools in the path.
- Xdebug 2.2.1 installed and loaded.
- phpunit installed and available in the path
For Xdebug installation, please refer to http://xdebug.org/wizard.php for help on this – or contact me through the mailinglist.
For PHPUnit installation, please refer to http://www.phpunit.de/manual/3.7/en/installation.html (you don’t need any of the optional things).
You also need to have an IDE installed either on your Linux machine or on the client side if you use a Linux VM. I will only cover netbeans and PHP Storm because of limited availability of time.
If you have a Linux host/desktop, then please also install KCacheGrind through your package manager.
Derick Rethans is a PHP internals expert, author of Xdebug and an OpenStreetMap and mapping enthusiast. He has contributed in a number of ways to the PHP project, including the Xdebug debugging tool, and various extensions and additions. He’s a frequent lecturer at conferences, the author of php|architect’s Guide to Date and Time Programming, and the co-author of PHP 5 Power Programming. He’s now working with 10gen to help improve the MongoDB PHP driver.