Getting started with Xdebug

The most common way of debugging a PHP application is to use some functions such as echo, die(), var_dump(),and print_r(). In Magento, you can use the Mage::log() statement to print some logs to a file, but this isn't a real debugger.

With a real debugger, you can break the script and look at the variables and values they have. You can also change values, go further, skip statements, and more.

In PHP, you can configure Xdebug to debug your PHP script or application. In this recipe, we will see how to install Xdebug in the development environment and how we can integrate it with an IDE.

Getting ready

In this recipe, we will start an Xdebug session with the NetBeans IDE. Open NetBeans and set the Magento project as Main ...

Get Magento 1.8 Development Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.