【发布时间】:2018-10-16 11:17:26
【问题描述】:
我无法让 VS Code 扩展“Php 调试”在任何断点处停止。我正在我的 Ubuntu 笔记本电脑上从 Docker 运行 php 项目(我想调试)。非常感谢任何建议。
我的设置:
- Docker 上的 PHP 版本:7.1
- Docker 上的 XDebug 版本:2.6.1
- VS Code 中的 PHP 调试版本(在我的笔记本电脑上):1.12.6
我的 VS Code launch.json 文件是:
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"log": true,
"pathMappings": {
"/var/www/html": "/home/chris/my-test-debugging-project"
}
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}
我的 /usr/local/etc/php/conf.d/xdebug.ini 配置是:
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_host=172.17.0.2
xdebug.remote_log=/var/www/html/xdebug.log
xdebug.remote_connect_back=0
xdebug.remote_port=9000
XDebug 日志文件(来自在 php.ini 中设置 xdebug.remote_log):
Log opened at 2018-10-14 05:47:16
I: Connecting to configured address/port: 172.17.0.2:9000.
W: Creating socket for '172.17.0.2:9000', poll success, but error: Operation now in progress (29).
E: Could not connect to client. :-(
Log closed at 2018-10-
14 05:47:16
PHP Debug 日志输出(来自在 launch.json 中设置 "log": true):
<- launchResponse
Response {
seq: 0,
type: 'response',
request_seq: 2,
command: 'launch',
success: true }
【问题讨论】:
-
xdebug.ini 中的行在 xdebug 3 中发生了变化
标签: php docker visual-studio-code xdebug vscode-debugger