如何解决Visual Studio Code 调试器不会在除 index.php
我在 WSL 上的 php8.0 上有这个 xdebug 配置。
zend_extension=xdebug.so
xdebug.mode=debug
xdebug.client_port=9000
xdebug.discover_client_host=1
xdebug.start_with_request=yes
xdebug.log=/mnt/c/www/traces/xdebug.log
和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": 9000,"pathMappings": {
"/var/www/html/": "${workspaceFolder}"
}
},{
"name": "Launch currently open script","program": "${file}","cwd": "${fileDirname}","port": 9000
}
]
}
使用的扩展程序
https://github.com/xdebug/vscode-php-debug/actions?query=branch:main
现在,当我在 my-root-directory/public/index.php
上设置断点并在 VScode 上运行和调试并在 Google Chrome 上刷新时,它将在断点处停止。
my-root-directory/public/index.php
是浏览器访问应用时的入口文件。
但是
当我在 my-root-directory/app/controller/someController.php
上设置断点并在 VSCode 上运行和调试并在 Google Chrome 上刷新时。
它不会停在那里。
您是否遇到过这种情况,您的解决方案是什么?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。