I'm trying to set up Xdebug with Sublime Text 2 to debug PHP on my local machine but am getting absolutely nowhere. I'm running MAMP with PHP 5.4. I have this entered this at the end of my php.ini:
[xdebug]
zend_extension="/Applications/MAMP/bin/php/php5.4.4/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_autostart=1
The Xdebug.so extension comes with MAMP and I have verified that it is in the location specified in the php.ini file. I can see Xdebug info in my PHP info.
In Sublime Text 2, I have installed this package and changed the settings in my project to this:
{
"folders":
[
{
"path": "/Applications/MAMP/htdocs"
}
],
"settings": {
"xdebug": { "url": "http://localhost" }
}
}
I can press SHIFT and F8 to bring up the menu for the plugin in Sublime Text 2, and can add or remove breakpoints (a grey dot appears on the left side of the line of code). When I hit "Start Debugging", it opens up a browser with the "?XDEBUG_SESSION_START=sublime.xdebug" string appended to the url. But my breakpoints don't do anything.
I've tried adding xdebug_break(); into my code to see if that would stop the program, but it doesn't. The browser and the IDE just don't seem to be connected at all...
Any ideas?