martomo / SublimeTextXdebug

Xdebug debugger client for Sublime Text
MIT License
564 stars 89 forks source link

Trouble Establishing Connection (MAMP) #153

Open wootencl opened 8 years ago

wootencl commented 8 years ago

I'm having a little trouble getting a connection between my web application and Xdebug. I've been messing with it off and on for the past few days now with no success so I believe I'm begrudgingly going to have to move over to PHPStorm. But here's my setup so far:

This is my php.ini on my MAMP server (I changed both my php.ini file at the location /Application/MAMP/bin/php/php5.6.10/conf/php.ini and /Applications/MAMP/conf/php5.6.10/php.ini to get Xdebug up and running on the server):

[xdebug]
zend_extension="/Applications/MAMP/bin/php/php5.6.10/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9001
xdebug.remote_handler=dbgp
xdebug.remote_log="/Applications/MAMP/logs/xdebug_remote.log"

After installing the Xdebug package from package control for sublime my setting for the 'Xdebug Setting - User' are as follows:

{
  "port" : "9001",
  "url" : "http://localhost:8888/timeSheetApplication/app",
  "super_globals" : true,
  "path-mapping" : {
    "/Applications/MAMP/htdocs/timeSheetApplication/app" : "/Applications/MAMP/htdocs/timeSheetApplication/app"
  }
}

As you can see I tried moving over to port 9001 to ensure there would be no interference but that also didn't seem to help. I should add that I'm using grunt to keep track of everything in my application. With that my index.html file is located within the 'app' folder. Also here's the setup of that directory if that may be of help:

app
--api
----vendor
----.htaccess
----.index.php
some other stuff
--index.html

I'm adding this as I'm not sure if the fact that my index.php file not being in my root directory could cause issues. Though I tried having it in the root directory and that didn't seem to help my situation.

Also as I use chrome as my default browser I tried adding the plugin 'Xdebug Helper' and setting the idekey to sublime.xdebug to see if that would fix it but still to no avail.

Throughout all of this I the log was giving me the following error:

I: Connecting to configured address/port: localhost:9001.
E: Could not connect to client. :-(

Also another note which I'm not sure why would effect anything overall but I'm building this application using a javascript framework called Backbone. The only thing I've seen so far is how backbone changes the URLs and so sometimes it looks a little strange like this:

http://localhost:8888/timeSheetApplication/app/?XDEBUG_SESSION_START=sublime.xdebug#login

With the 'login' route being concatenated on to the end of the debug flag.

Some other system information: OS: OS X 10.10.5 Sublime Version: 2.0.2 Xdebug Version: 2.2.5

That's about all I've got. I'll come back and add anything as I move forward. Sadly though I think I'm going to move over to the much more bloated PHPstorm as I've already lost a ton of time trying to figure this out. Any help would be greatly appreciated and thanks in advance for any replies!