检查这个答案!
-
DBGp 代理客户端
从http://code.activestate.com/komodo/remotedebugging/下载
,我使用 Komodo-PythonRemoteDebugging-11.0.2-90813-linux-x86_64.tar
我的狂欢
#!/bin/bash
export PYTHONPATH=./pythonlib
python -c "import dbgp.client; print 'import lib ok'"
./pydbgpproxy -d 0.0.0.0:9999 -i 0.0.0.0:9001
然后运行
import lib ok
INFO: dbgp.proxy: starting proxy listeners. appid: 20018
INFO: dbgp.proxy: dbgp listener on 0.0.0.0:9999
INFO: dbgp.proxy: IDE listener on 0.0.0.0:9001
php xdebug.ini
xdebug.remote_handler = dbgp
xdebug.remote_host = 10.0.1.88 # DBGp ip
xdebug.remote_port = 9999 # DBGp port
-
带有端口的ssh隧道
.ssh/配置
# ...
RemoteForward 20000 localhost:20000 # vscode php-debug config
LocalForward 9001 localhost:9001 # DBGp port
# ...
并通过 ssh 连接
- vscode 启动.json
"configurations": [
{
"name" : "vscphpdebug",
"type" : "php",
"request" : "launch",
"port" : 20000,
"stopOnEntry" : false,
"pathMappings": {
"/server/php": "${workspaceFolder}"
},
}
]
在 vscode 中开始调试
- telnet DBGp 端口并注册密钥使用:proxyinit -p 20000 -k vscdebug -m 1
$telnet 127.0.0.1 9001
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
proxyinit -p 20000 -k vscdebug -m 1
<?xml version="1.0" encoding="UTF-8"?>
<proxyinit success="1" idekey="vscdebug" address="0.0.0.0" port="9999"/>Connection closed by foreign host.
并停止 DBGp 使用这个:proxystop -k vscdebug
$ telnet 127.0.0.1 9001
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
proxystop -k vscdebug
<?xml version="1.0" encoding="UTF-8"?>
<proxystop success="1" idekey="vscdebug"/>Connection closed by foreign host.
- 在 VSCode 上开始调试(PHP 调试
felixfbecker.php-debug)
调试愉快!