【问题标题】:VSCode + Xdebug + PHP configurationVSCode + Xdebug + PHP 配置
【发布时间】:2019-03-15 01:00:18
【问题描述】:

我正在尝试使用 VScode 设置 Xdebug,但每当我设置断点时它都会忽略它。

我安装了https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug 并按照说明进行操作(Windows),我还使用了 Xdebug Wizard,这是我的配置:

Vscode - launch.json

{
  "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

zend_extension = D:\wamp\bin\php\php7.1.16\ext\php_xdebug-2.6.1-7.1-vc14.dll

[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_log=D:\wamp\logs\xdebug.log

注意:我找不到任何日志,我可能没有正确设置它,但我也不知道如何使它工作

php -v

$ php -v
PHP 7.1.16 (cli) (built: Mar 28 2018 21:27:36) ( ZTS MSVC14 (Visual C++ 2015) x8
6 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans

感谢您的阅读!

【问题讨论】:

    标签: php visual-studio-code xdebug vscode-debugger


    【解决方案1】:

    我相信您的php.ini 中可能需要以下内容:

    xdebug.remote_connect_back=1
    

    请参阅xdebug.ini 了解 WPLib Box 的 PHP 容器,该容器绝对适用于 XDEBUG 和 VS Code。

    【讨论】:

      猜你喜欢
      • 2021-05-17
      • 2020-06-20
      • 1970-01-01
      • 2021-04-03
      • 2019-07-19
      • 1970-01-01
      • 2017-08-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多