Install xDebug with Sublime for Drupal (Mac, PC, Windows or OSX)

I'll try to make this quick. Installing xdebug for drupal is the same as installing it for anything else like wordpress etc

So what you need to do is to get xdebug to your php folder. This is different depending on system you use, for example OSX has it already when you install MAMP so you will just need to enable it. Go to your php.ini file and find XDEBUG part and active it(remove comment from zend_extension) and add some lines below like, but probably would even work without them, maybe just include first line.

zend_extension=/usr/lib/php5/20100525/xdebug.so
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9001
xdebug.remote_handler="dbgp"

After that restart server and check your phpinfo and see if it is installed and working.

After that open your sublime and find and install xdebug client in package installer. After that if you didn't make your drupal folder as project, go and make it and save project to drupal root folder. After that edit that file you saved and make it look like this

{
    "folders":
    [
        {
            "follow_symlinks": true,
            "path": "."
        }
    ],
    "settings": {
        "xdebug": {
             "url": "http://localhost:8888/kt/",
        }
    }
}

and save it. Now restart your sublime to make this all work. And then you can debug and set breakpoints. You can also start debugging with tools->xdebug and use options there. And run browser to start debugging. You will notice that your website is opened up and that ?XDEBUG_SESSION_START=sublime.xdebug is added to url. This is needed to run xdebug. But there is also Chrome extension that could help you here. Install xdebug helper from https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldj… and use it to quickly activate xdebug. That is all.