VSCode Xdebug 不会在断点处停止
VSCode with Xdebug doesn't stop at breakpoint
我有一个初学者的问题。我正在努力让 Xdebug 在 Visual Studio 代码中为 PHP 运行。我尝试了很多,但似乎没有任何效果。 VSCode 不会在我的断点处停止。这是我已经尝试或设置的事情列表:
- 我在 XAMPP 中从 Apache 服务器编辑了 PHP.ini。如您所见,我已经添加了 dll:
[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.idekey="vscode"
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.remote_port = "8066"
zend_extension = C:\xampp\php\ext\php_xdebug-3.0.3-8.0-vs16-x86_64.dll
- 确保 Apache 服务器监听 8066 端口。
- 在 Visual Studio 代码中我安装了 PHP 调试和其他 PHP 智能东西
- VSCcode中的launch.json如下:
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 8066,
"runtimeExecutable": "C:/xampp/php/php.exe"
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 8066,
"runtimeExecutable": "C:/xampp/php/php.exe"
- 我也在VSCode中设置了php.exe为标准:
我做错了什么?我敢打赌这是非常愚蠢的事情。希望大家多多指教
我解决了我的问题如下:
我把Apache服务器设置到另外一个不是9000或者9003的端口
读完 link 我明白了 V2.所以我将 xdebug 设置更改为 only:
xdebug.remote_autostart = yes
xdebug.mode = debug
zend_extension = C:\xampp\php\ext\php_xdebug-3.0.3-8.0-vs16-x86_64.dll
https://xdebug.org/docs/upgrade_guide
- 在 visual studio 代码中,我将 launch.json 端口更改为 9003(这是 Xdebug 中的默认端口)
效果很好!谢谢 LazyOne!
我有一个初学者的问题。我正在努力让 Xdebug 在 Visual Studio 代码中为 PHP 运行。我尝试了很多,但似乎没有任何效果。 VSCode 不会在我的断点处停止。这是我已经尝试或设置的事情列表:
- 我在 XAMPP 中从 Apache 服务器编辑了 PHP.ini。如您所见,我已经添加了 dll:
[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.idekey="vscode"
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.remote_port = "8066"
zend_extension = C:\xampp\php\ext\php_xdebug-3.0.3-8.0-vs16-x86_64.dll
- 确保 Apache 服务器监听 8066 端口。
- 在 Visual Studio 代码中我安装了 PHP 调试和其他 PHP 智能东西
- VSCcode中的launch.json如下:
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 8066,
"runtimeExecutable": "C:/xampp/php/php.exe"
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 8066,
"runtimeExecutable": "C:/xampp/php/php.exe"
- 我也在VSCode中设置了php.exe为标准:
我做错了什么?我敢打赌这是非常愚蠢的事情。希望大家多多指教
我解决了我的问题如下:
我把Apache服务器设置到另外一个不是9000或者9003的端口
读完 link 我明白了 V2.所以我将 xdebug 设置更改为 only:
xdebug.remote_autostart = yes xdebug.mode = debug zend_extension = C:\xampp\php\ext\php_xdebug-3.0.3-8.0-vs16-x86_64.dll
https://xdebug.org/docs/upgrade_guide
- 在 visual studio 代码中,我将 launch.json 端口更改为 9003(这是 Xdebug 中的默认端口)
效果很好!谢谢 LazyOne!