热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

VSCode+Xdebug+PHP配置

如何解决《VSCode+Xdebug+PHP配置》经验,为你挑选了1个好方法。

我正在尝试使用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

谢谢您的阅读!



1> MikeSchinkel..:

我相信您可能需要php.ini

xdebug.remote_connect_back=1

请参阅xdebug.iniWPLib Box的PHP容器,该容器肯定可以与XDEBUG和VS Code一起使用。


推荐阅读
author-avatar
mobiledu2502879827
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有