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



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 →

2 Comments on “Configure Xdebug In Sublime Text Editor For Magento Project”

  1. The installing package not working for sublime 3

    use this:
    import urllib.request,os,hashlib; h = ‘6f4c264a24d933ce70df5dedcf1dcaee’ + ‘ebe013ee18cced0ef93d5f746d80ef60’; pf = ‘Package Control.sublime-package’; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( ‘’ + pf.replace(‘ ‘, ‘%20’)).read(); dh = hashlib.sha256(by).hexdigest(); print(‘Error validating download (got %s instead of %s), please try manual install’ % (dh, h)) if dh != h else open(os.path.join( ipp, pf), ‘wb’ ).write(by)

    ref link:

  2. You cannot install the xdebug-client directly. Download the zip file and move those into the ~/.config/sublime-text-3/Packages/User/ directory

Leave a Reply

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