簡體   English   中英

VSCode + Xdebug + PHP配置

[英]VSCode + Xdebug + PHP configuration

我正在嘗試使用VScode設置Xdebug,但是每當設置斷點時,它都會忽略它。

我安裝了https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug並按照說明進行操作(Windows),我還使用了Xdebug向導,這是我的配置:

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.ini需要以下內容:

xdebug.remote_connect_back=1

請參閱xdebug.ini了解WPLib Box的PHP容器,該容器肯定可以與XDEBUG和VS Code一起使用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM