I wrote an earlier post about setting up the xDebug PHP debugger with the Sublime editor under Windows 7.
I'm now migrating to developing on a Linux system and have done this set up for Sublime Text 3 and Linux Mint 17.
This post borrows heavily from the earlier article.
(1) Installed xDebug 2.2.3 extension for PHP.
(a) While logged in as root,
# apt-get install php5-xdebug
This installed the php5-xdebug package, creating the two files
On your system, the path for xdebug.so may be a little different.
20-xdebug.ini is actually a link to the file mentioned in step (2) below.
(b) Restarted Apache. Loaded a page containing a call to phpinfo() to check that the extension was installed. On the page there appeared an xdebug section with several tables that showed settings and directives.
(2) Added directives for xDebug.
Edited /etc/php5/mods-available/xdebug.ini to include the following lines.
xdebug.remote_enable = On
xdebug.remote_host = "localhost"
xdebug.remote_port = 9000
xdebug.remote_handler = "dbgp"
xdebug.remote_autostart = On
xdebug.remote_mode = req
xdebug.remote_connect_back = 0
Because I only want to debug locally, I set xdebug.remote_connect_back to 0 to turn it off. I believe this should be set to 1 if
you intend to debug a site running on a remote system.
(3) Installed the Sublime package manager, "Package Control".
(a) Within Sublime, clicked Preferences > Browse Packages, then browsed up one level to find the full path for the Installed Packages folder. On my system the path is
(b) Downloaded the file Package Control.sublime-package from
(c) Copied that file into the Installed Packages directory.
(d) Re-started Sublime.
In Sublime's Command Palette window, various Package Control commands are then available on the palette and elsewhere.
(4) Using Sublime's Package Control, installed the Xdebug Client package.
Tools > Command Palette ... > Package Control: Install Package
Typed Xdebug Client into the search field, and clicked on Xdebug Client in the search results to install.
This adds a submenu, Tools > Xdebug, or you can use the keyboard equivalents.
(5) To start an xDebug session.
start a debugging session, I load the site by appending the query string ?XDEBUG_SESSION_START=1 to the initial url, like so.
The value of XDEBUG_SESSION_START is a session name that is stored in a cookie, so it probably could be any name you choose.
are other ways to start an xDebug session, but for getting started with
using this debugger, this seems like the simplest.
Finally, in Sublime itself, to activate the editor as an xDebug client,
Tools > Xdebug > Start Debugging
Debug PHP with Xdebug in Sublime Text 2 (in Linux mint)
XDEBUG EXTENSION FOR PHP
martomo / SublimeTextXdebug
Download: Package Control.sublime-package