Отладчик Visual Studio Code не останавливается на точке останова в любых других файлах, кроме index.php.
У меня есть эта конфигурация xdebug на php8.0 на WSL.
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 и обновляюсь в Google Chrome, он останавливается на точке останова.
my-root-directory/public/index.php
является файлом входа при посещении приложения в браузере.
Но
Когда я устанавливаю точки останова
my-root-directory/app/controller/someController.php
и запускать и отлаживать VSCode и обновлять в Google Chrome.
Это не остановится на достигнутом.
Сталкивались ли вы с этим и каково ваше решение?