Closed sharak closed 1 year ago
In your pathMappings
you have a typo. Instead of {$workspaceFolder}
try ${workspaceFolder}
. You can look at this page for reference: https://code.visualstudio.com/docs/editor/variables-reference
OMG! What a fool! 😅
It works, obviously. A whole morning lost for a typo.
Thank you and sorry for the foolishness 😕
Don't worry. There is a proverb I like to user when this happens to me: Couldn't see the forest for the trees.
PHP version: 8.2.5-fpm (inside docker) Xdebug version: 3.2.0 VS Code extension version: v1.32.1
Your launch.json:
Xdebug php.ini config:
Xdebug logfile (from setting `xdebug.log` in php.ini)
``` [7] Log opened at 2023-05-02 12:15:56.636296 [7] [Step Debug] INFO: Connecting to configured address/port: host.docker.internal:9003. [7] [Step Debug] INFO: Connected to debugging client: host.docker.internal:9003 (through xdebug.client_host/xdebug.client_port). [7] [Step Debug] ->VS Code extension logfile (from setting `"log": true` in launch.json)
``` Listening on { address: '0.0.0.0', family: 'IPv4', port: 9003 } <- launchResponse Response { seq: 0, type: 'response', request_seq: 2, command: 'launch', success: true } <- initializedEvent InitializedEvent { seq: 0, type: 'event', event: 'initialized' } -> setBreakpointsRequest { command: 'setBreakpoints', arguments: { source: { name: 'index.php', path: '/home/projects/sesame-service/public/index.php' }, lines: [ 6 ], breakpoints: [ { line: 6 } ], sourceModified: false }, type: 'request', seq: 3 } <- setBreakpointsResponse Response { seq: 0, type: 'response', request_seq: 3, command: 'setBreakpoints', success: true, body: { breakpoints: [ { verified: true, line: 6, source: { name: 'index.php', path: '/home/projects/sesame-service/public/index.php' }, id: 1 } ] } } -> setFunctionBreakpointsRequest { command: 'setFunctionBreakpoints', arguments: { breakpoints: [] }, type: 'request', seq: 4 } <- setFunctionBreakpointsResponse Response { seq: 0, type: 'response', request_seq: 4, command: 'setFunctionBreakpoints', success: true, body: { breakpoints: [] } } -> setExceptionBreakpointsRequest { command: 'setExceptionBreakpoints', arguments: { filters: [] }, type: 'request', seq: 5 } <- setExceptionBreakpointsResponse Response { seq: 0, type: 'response', request_seq: 5, command: 'setExceptionBreakpoints', success: true, body: { breakpoints: [] } } -> configurationDoneRequest { command: 'configurationDone', type: 'request', seq: 6 } <- configurationDoneResponse Response { seq: 0, type: 'response', request_seq: 6, command: 'configurationDone', success: true } -> threadsRequest { command: 'threads', type: 'request', seq: 7 } <- threadsResponse Response { seq: 0, type: 'response', request_seq: 7, command: 'threads', success: true, body: { threads: [] } } new connection 1 from 127.0.0.1 xd(1) ->When we start a debugging session and define a breakpoint the debugger does not stop at the defined breakpoint. xdebug_info displays the following:![image](https://user-images.githubusercontent.com/985713/235666065-7af027a9-97e0-4cc5-9fe1-c6d8669f9cae.png)
If we set an xdebug_break(), it tries to open a file that does not exist inside the
/mnt/c/Users/User/AppData/Local/Programs/Microsoft VS Code/{$workspaceFolder}
folder.If we remove the
hostname
line from the launch.json file the debugger says that it cannot connect to host.docker.internal:9003.The application is accessed through an nginx proxy that resolves to the php container in docker.