Can not get PHP debugging to work #1556
-
|
I usually use PHPStorm but sometimes I need a quick way to debug a small script. handlers = {
php = function()
local adapter_root = require('mason-core.installer.InstallLocation').global():package 'php-debug-adapter'
require('dap').adapters.php = {
type = 'executable',
command = 'node',
args = { adapter_root .. '/extension/out/phpDebug.js' },
}
require('dap').configurations.php = {
{
type = 'php',
request = 'launch',
name = 'Debug current file',
program = '${file}',
cwd = '${fileDirname}',
-- Lazy load xdebug because it is not enabled as PHP module
runtimeArgs = { '-dzend_extension=/usr/lib/php/20240924/xdebug.so' },
port = 0,
xdebugSettings = {
mode = 'debug',
start_with_request = 'trigger',
max_data = 0,
show_hidden = 1,
max_children = 100,
max_depth = 3,
breakpoint_include_return_value = 1,
},
log = true,
},
}
end,
}
|
Beta Was this translation helpful? Give feedback.
Answered by
metalinspired
Sep 27, 2025
Replies: 1 comment
-
|
Fixed by changing the config to: require('dap').configurations.php = {
{
type = 'php',
request = 'launch',
name = 'Debug current file',
program = '${file}',
cwd = '${fileDirname}',
runtimeArgs = {
'-dzend_extension=/usr/lib/php/20240924/xdebug.so', -- Needed to "lazy" load xDebug
'-dxdebug.mode=debug',
'-dxdebug.start_with_request=yes',
},
xdebugSettings = {
max_data = 0,
show_hidden = 1,
max_children = 100,
max_depth = 3,
},
},
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
metalinspired
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed by changing the config to: