Xdebug无法在断点处停止的调试问题求助
Xdebug无法在断点处停止
Xdebug无法在断点处停止,我已经尝试了多个版本的Xdebug扩展,包括当前使用的v1.32.1,以及v1.32.0、v1.31.1、v1.31.0、v1.30.0。
VS Code的launch.json配置
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Listen for Xdebug", "type": "php", "request": "launch", "port": 9003 }, { "name": "Launch currently open script", "type": "php", "request": "launch", "program": "${file}", "cwd": "${fileDirname}", "port": 0, "runtimeArgs": [ "-dxdebug.start_with_request=yes" ], "env": { "XDEBUG_MODE": "debug,develop", "XDEBUG_CONFIG": "client_port=${port}" } }, { "name": "Launch Built-in web server", "type": "php", "request": "launch", "runtimeArgs": [ "-dxdebug.mode=debug", "-dxdebug.start_with_request=yes", "-S", "localhost:0" ], "program": "", "cwd": "${workspaceRoot}", "port": 9003, "serverReadyAction": { "pattern": "Development Server \\(http://localhost:([0-9]+)\\) started", "uriFormat": "http://localhost:%s", "action": "openExternally" } } ]}
是否存在与Web服务器的冲突?
php.ini中的Xdebug配置
[xdebug] zend_extension=C:\xampp\php\ext\php_xdebug.dll xdebug.mode = debug xdebug.start_with_request = yes xdebug.client_port = 9003 // 即使去掉这一行也无法正常工作
Xdebug安装向导检测信息
Summary from <https://xdebug.org/wizard> • Xdebug installed: 3.2.1 • Server API: Apache 2.0 Handler • Windows: yes • Compiler: MS VS16 • Architecture: x64 • Zend Server: no • PHP Version: 8.2.4 • Zend API nr: 420220829 • PHP API nr: 20220829 • Debug Build: no • Thread Safe Build: yes • OPcache Loaded: no • Configuration File Path: no value • Configuration File: C:\xampp\php\php.ini • Extensions directory: C:\xampp\php\ext
相关截图




已尝试的操作
我已经通过向导下载对应文件并正确重命名,根据文档使用默认端口9003,也尝试过9000,但通过端口检测工具发现9000和9003端口均处于关闭状态。
此外我还执行了以下操作:
- 重装XAMPP
- 重装VS Code
- 开启VS Code中
Settings -> Features -> Debug -> Allow Breakpoints Everywhere选项
内容的提问来源于stack exchange,提问作者Nils
相关产品推荐
相关产品推荐

