【发布时间】:2020-01-27 06:22:51
【问题描述】:
当我在 VSCode 上启动调试器时,一切似乎都在工作,因为下栏变成了橙色等……但是,当我添加断点时,站点会忽略它并保持正常加载。当我在launch.json 上添加配置时,php 也不会出现。 Xdebug 不会创建日志。
我已经仔细检查了所有路径,下载了 Xdebug 的 dll 并在 php.ini、settings.json 和 launch.json 上添加了必要的行。
php -v 给了我 7.3.5 版本,在 WAMP 上它是相同的版本(在桌面和http://localhost/?phpinfo=-1 上验证)
settings.json
{
"telemetry.enableTelemetry": false,
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
"window.zoomLevel": -1,
"C_Cpp.updateChannel": "Insiders",
"arduino.path": "C:\\Program Files (x86)\\Arduino",
"[javascript]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"[html]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"editor.minimap.enabled": false,
"php.validate.enable": true,
"php.executablePath": "c:/wamp64/bin/php/php7.3.5/php.exe",
"php.validate.executablePath": "c:/wamp64/bin/php/php7.3.5/php.exe",
"php.validate.run": "onSave",
"files.associations": {
"*.inc": "php"
},
"git.autofetch": true,
"git.enableSmartCommit": true
}
launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}
php.ini
[XDebug]
zend_extension="c:/wamp64/bin/php/php7.3.5/ext/php_xdebug-2.8.0beta2-7.3-vc15-x86_64.dll"
xdebug.remote_enable = 1
xdebug.remote_autostart=on
xdebug.remote_port = 9000
xdebug.remote_log="c:/"
我也没有收到任何错误消息。
【问题讨论】:
标签: php windows visual-studio-code xdebug