【问题标题】:visual studio code php xdebug not working视觉工作室代码php xdebug不工作
【发布时间】:2018-07-05 17:26:21
【问题描述】:

我安装了 XAMPP。 我还在 Visual Studio Code 中安装了 PHP intelliSence 和 PHP 调试。 我在 .../php/ext/ 中设置了 php_xdebug.dll。

虽然我在我的 php 文件上设置了一些断点,但它不起作用...

你能告诉我如何在 vs 代码中调试 php 吗?

launch.json

{
        "name": "Listen for XDebug",
        "type": "php",
        "request": "launch",
        "port": 9010,
        "pathMappings": {
                "${C:/xampp/tdocs}": "${workspaceRoot}"
            }
    }

PHP.ini

[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9010
xdebug.auto_trace = 1
xdebug.trace_output_dir = "C:\xampp\trace"
xdebug.idekey = "phpstorm"

【问题讨论】:

    标签: php debugging visual-studio-code xampp xdebug


    【解决方案1】:

    我解决了这个问题。 我修复了以下问题。

    • 我已将 xdebug 文件名从默认重命名为“php_xdebug.dll”,但它不起作用,所以我尽量不更改名称。
    • Xdebug 运行良好,然后我访问 localhost/***.php。

    【讨论】:

    • 感谢分享解决方案。您可以将您的回复标记为答案。
    猜你喜欢
    • 2020-06-14
    • 1970-01-01
    • 2021-09-01
    • 2015-07-10
    • 1970-01-01
    • 2017-04-01
    • 1970-01-01
    • 2023-04-01
    • 1970-01-01
    相关资源
    最近更新 更多