Magento Code Debugging Through Eclipse PDT

Magento Code Debugging Through Eclipse PDT

October 12, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento Code Debugging Through Eclipse PDT

Debugging Magento Code Using Eclipse PDT

Debugging is an essential part of developing and maintaining Magento extensions or customizations. In this post, we’ll guide you through the process of effectively debugging Magento code using the Eclipse PDT IDE.

Setting Up X-Debugger for Magento

Before starting, ensure that your development environment has X-Debugger properly installed and configured. Follow the official X-Debugger installation guide to set it up with Apache or Nginx on your local server.

In your php.ini file, make sure you have these lines:

zend_extension=xdebug.so

xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_port=9003

Save this file and restart your webserver for changes to take effect.

Configuring Eclipse PDT for Magento Debugging

Open your project in Eclipse, right-click on the project folder, and select Properties. In the pop-up window, go to PHP Include Path under the Build Path tab. Add the root directory of your Magento installation (usually /var/www/html/magento).

Now, let’s set up a debugging session:

  1. Go to Run -> Debug Configurations.
  2. Under PHP Web Page, create a new configuration named “Magento Debug”.
  3. In the Main tab:
    • Browse and select your Magento root directory.
  4. In the Server tab:
    • Enter localhost:9000 as the host name/port.
  5. Click Apply and then Run to start a debugging session.

Debugging Index.php

You mentioned that the debugger stops at the last line of index.php. This is expected behavior since the script execution ends there. To proceed with your checkout process, you’ll need to set breakpoints in the specific controller file handling the request, not just index.php.

OnePage Checkout Debugging Steps

To debug the one-page checkout process:

  1. Open your Magento project’s app/code/core/Mage/Checkout/controllers/OnepageController.php file.
  2. Set a breakpoint at line 87 where the $action = $this->getRequest()->getParam('action'); statement resides.
  3. Go to your browser and open the one-page checkout page (usually /checkout/onepage/).
  4. When the debugger hits the breakpoint, you’ll be able to inspect variables like $action, which determines the next step in the checkout process.

Remember that debugging controller files is more relevant than index.php for specific functionality debugging, such as the checkout process.

Conclusion

Debugging Magento code using Eclipse PDT is a powerful tool for identifying and fixing issues. Proper configuration of X-Debugger and setting breakpoints in the right places are crucial for an effective debugging experience.

For more advanced debugging techniques and Magento best practices, consider exploring our Magento Development Services at Laravel Company. Our expert team is ready to assist with any development or troubleshooting requirements you may have.

API Extensions Configuration CLI

Our network