Setting up XDebug with SublimeText 2 on Mac OS X

I've been trying to set up debugging on and off with SublimeText over the years, and I never quite got it right. Today I was determined to make it work and finally I managed.
Our Sponsors
Essential plugins for your WooCommerce store
Build unbuildable WordPress websites
Try Kinsta WordPress hosting risk-free for 30 days
The best no-code Instagram feed plugin for WordPress
Automate marketing for WooCommerce, from hi to buy!

I’ve been trying to set up debugging on and off with SublimeText over the years, and I never quite got it right.

Today I was determined to make it work and finally I managed.

Here are the links I used to set it up, they are mostly the same, so the first one should be enough:

After setting XDebug with SublimeText I ran some tests with a simple PHP file before trying it out with WordPress itself, setting a breakpoint in the index.php file in the root WordPress folder. This allowed me to go through the loading process of WordPress, which is a very interesting journey I recommend you take if you haven’t done it yet.

While I was at it, I also wanted to set up file handlers so that when I got PHP warnings or errors that included a stack trace, I could click on the files shown and they would open directly in SublimeText. For that I found this guide handy: http://simonwheatley.co.uk/2012/07/clickable-stack-traces/

To make the subl handler work I tried to use this, however I haven’t managed to make it work yet.
https://github.com/asuth/subl-handler

For activating the debug session in the browser, I used the XDebug Chrome Helper.

If you enjoyed this post, make sure to subscribe to WP Mayor’s RSS feed.

Jean Galea
Jean Galea
Jean Galea is a WordPress developer, entrepreneur and padel player. He is the founder of WP Mayor, the plugins WP RSS Aggregator and EDD Bookings, as well as the Mastermind.fm podcast. His personal blog can be found at jeangalea.com.

Consider sharing this post so others can find it:

Share on facebook
Share on twitter
Share on linkedin
Share on reddit
Share on telegram
Share on whatsapp
Share on pocket
Share on email

Join thousands of people receiving real-world, genuine evaluations of WordPress products and services just like this one every week.

Table of Contents

Leave a Reply

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

The Beginner’s Handbook
From an introduction on how WordPress works to our recommendations on products and services.
👋 Hey there! We're Gaby and Mark
Every week we share genuine reviews of WordPress products and services in our newsletter.
Thousands of people read it!
We’d love for you to join.
We’d love for you to join. Here’s what you’ll be getting:

A single weekly email directly to your inbox.