gpt4 book ai didi

php - VSCode调试器跳过断点

转载 作者:行者123 更新时间:2023-12-03 11:10:32 30 4
gpt4 key购买 nike

当我在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:/"

我也没有收到任何错误消息。

最佳答案

进行日志记录:可能不允许Web服务器写入c:/-您可能要使用c:/temp(或任何临时目录路径)。

至于不停止,则您的网络服务器的路径与硬盘驱动器上的本地路径可能不相同,并且您需要设置“路径映射”:https://github.com/felixfbecker/vscode-php-debug/blob/master/README.md#remote-host-debugging

关于php - VSCode调试器跳过断点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58125836/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com