php - VSCode调试器跳过断点

标签 php windows visual-studio-code xdebug

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

相关文章:

php - 同时连接2个数据库,将字段复制到第二个数据库

visual-studio-code - Visual Studio 代码 - 如何复制搜索结果?

visual-studio-code - 如何打印 vscode 中的设置值?

node-webkit - Visual Studio Code 编辑器是基于什么构建的

php - 根据 ID 将序列化的 JS 数组分组为相似的对象/数组

php - MySQL:选择与多行匹配的项目

php - 您可以使用 PDO 将占位符放在查询的选定部分吗?

windows - 从 Powershell 更新计划任务脚本

c# - 测量 C# + Mono 中可用的内存量

linux - 使用 Python 在一种语法中使用多个引号