Configure Xdebug In Sublime Text Editor For Magento Project

This article describe the step by step process of configure xdebug in sublime text editor for magento project.

1. Install Sublime Text Editor

If you already have sublime text editor please skip this step

For Sublime-Text-2:

For Sublime-Text-3:

2. Install Xdebug

Please run the below command to find the right xdebug package to install

It should return the information like below

php-xdebug – Xdebug Module for PHP

so we need to install php-xdebug (it may be vary like php5.6-xdebug, php7-xdebug….)

Add the below contents at the end of /etc/php/your_version/apache2/php.ini

Restart the apache

3. Install Xdebug client in Sublime

Sublime -> View -> Show Console

install xdebug client

 

Please paste the below content as per your sublime version in cosole like above screen shot then hit ENTER

Subl3

subl2

Open up Command Pallete (Ctrl+Shift+P Windows/Linux; Cmd+Shift+P Mac OS users)

command pallet

 

Start typing install. Press Enter when Package Control: Install Package appears

package control

 

Type XDebug and choose XDebug Client

xdebug client

 

Restart sublime

4. Create Project

Open Magento 2 folder in Sublime Text after that go to Project->Save Project As and save it within the root of your magento application as mage2.sublime-project.

create project

 

Then edit the sublime project (mage2.sublime-project) file content like below

That’s it!

When you have at least one breakpoint set, you can go to Tools->XDebug->Start Debugging (Launch Browser) and have fun

start debug

debug output

About Bilal

I'm a software programmer, I handle Magento2 modifications at any level.

View all posts by Bilal →

Leave a Reply

Your email address will not be published. Required fields are marked *