【问题标题】:Why not working breakpoint in PHP VSCode?为什么不在 PHP VSCode 中工作断点?
【发布时间】:2021-04-01 01:55:53
【问题描述】:
  1. c:\xampp 中安装 XAMPP v3.2.4 x64 并设置环境变量的路径

  1. 获取phpinfo()中的所有文本并按照https://xdebug.org/wizard下载dll文件并复制到c:\xampp\php\ext 并在php.ini 末尾添加文本zend_extension=path 并检查phpinfo() 页面和xdebug 添加到此

  1. 添加[XDebug] xdebug.remote_enable = 1 xdebug.remote_autostart = 1 在 php.ini 中

  1. 安装 VSCode v1.52.1

  1. 安装 PHP Debug v1.13.1

  1. htdocs 测试名称中创建项目并在test.php 中创建文件

  1. test.php 中输入文本并在行中设置断点

  2. 为 PHP 创建自动 launch.json

  1. 开始调试

  2. 启动chrome和url:localhost/test/test.php

但是当刷新页面断点不起作用并且不停止代码时。

【问题讨论】:

标签: php visual-studio-code xdebug


【解决方案1】:

只需检查监听端口

[XDebug]
zend_extension=C:\xampp\php\ext\php_xdebug-3.0.1-7.2-vc15-x86_64.dll
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.mode=debug
xdebug.idekey=VSCODE
xdebug.start_with_request=yes
xdebug.client_host=127.0.0.1
xdebug.client_port=9000

【讨论】:

  • Xdebug v3 不需要这两行:xdebug.remote_enable = 1xdebug.remote_autostart = 1。当 Xdebug 3 看到旧的 v2 值时,它会在你的错误日志中抱怨它们。它执行的每个 PHP 脚本都可能发生这种情况,因此您的错误日志可能会被不必要的条目淹没。
猜你喜欢
  • 2021-07-21
  • 1970-01-01
  • 2021-02-14
  • 2019-11-12
  • 1970-01-01
  • 2021-08-05
  • 2016-11-19
  • 2013-07-09
  • 1970-01-01
相关资源
最近更新 更多