visual-studio-code - 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",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}
使用的扩展名
https://github.com/xdebug/vscode-php-debug/actions?query=branch:main
现在,当我在 VScode 上设置断点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 上刷新时。
它不会停在那里。
您是否遇到过这种情况,您的解决方案是什么?
解决方案
推荐阅读
- python - 使用递归从两个列表创建对列表
- ios - SwiftUI NavigationBarItems slideBack 冻结应用程序
- google-drive-api - Google Colab / Google Drive 和 h5py 文件存储
- python - pygame连续下雨
- highcharts - 在高地图中加入多个宫廷
- ios - 以编程方式将 UIViewController 加载到容器视图中
- javascript - 如何使用 jQuery 更改带有按钮的背景图片 url
- python - ubuntu 上的 Python 无法识别当前包
- spring - 使用嵌入式 Ldap 进行春季身份验证
- postgresql - 无法连接到服务器(postgres)-GCP-Kubernetes