martomo / SublimeTextXdebug

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

Remote control xDebug in Sublime Text 3, with xDebug Client #138

Open indikatordesign opened 9 years ago

indikatordesign commented 9 years ago

I wanna use xDebug with Sublime to debug my PHP-App on a live-testserver (no local install). Hope someone has a nice tip for me. I searched for 3 days now, but can't get it to work.

Remote Server (VPS): PHP 5.3.10 on Ubuntu 12.04 LTS, xDebug 2.10, Apache 2.2

Client: Mac OSX, Mavericks, Sublime Text 3 Build 3083

All my xDebug-settings are shown right in phpinfo(). Here are the settings in /etc/php5/conf.d/xdebug.ini (it's also included for Additional .ini files parsed in phpinfo):

xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_autostart=0
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
; xdebug.remote_host=localhost
xdebug.remote_port=7655
xdebug.remote_connect_back=1
xdebug.remote_log=/var/log/xdebug/xdebug.log
xdebug.idekey=my.sublime.key
xdebug.profiler_enable_trigger=On
xdebug.profiler_output_dir=/tmp
xdebug.max_nesting_level=200

Here are my Sublime Settings:

Sublime Project:

{
    "folders":
    [
        {
            "follow_symlinks": true,
            "path": "/path/on/local/machine/"
        }
    ],
    "settings": {
        "xdebug": {
            "url": "http://my-domain.de/",
            "ide_key": "my.sublime.key",
            "port": 7655,
            "debug": true,
            "max_depth": 4,
            "super_globals": true,
            "break_on_start": true
        }
    }
}

xDebug Sublime Settings:

{
    "url": "http://my-domain.de/",
    "ide_key": "my.sublime.key",
    "port": 7655,
    "debug": true,
    "max_depth": 4,
    "super_globals": true,
    "break_on_start": true
}

I mounted my Wep-App with OSX-Fuse and sshfs.

sshfs user@ip:/path/on/server/to/app/folder/ /path/on/local/machine/

There are no infos inside Sublime-Console and nothing is written inside the configured log-file. If I start debugging with launch browser, it takes a while with no results.

I tried also with pathmapping, but it do not work also.

"path_mapping": {
    "/path/on/server/to/app/folder/" : "/path/on/local/machine/"
},

Someone with a tipp? Thanks

Thakao commented 8 years ago

I think that you must not point to localhost

xdebug.remote_host = "localhost"

,but to the IP of the host of the Debuging Session(Clients IP).

In my case the VPS is running in a VPN under Bridge-mode. So i detected the host ip in the VPN ; VPS 10.0.0.10, Host 10.0.0.1 and BANG!, it worked .