View Issue Details

IDProjectCategoryView StatusLast Update
0002411XdebugPath Mappingpublic2026-06-08 14:36
Reporterclubdrei_chris Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinux (Docker)OSUbuntuOS Version24.04
Product Version3.5.1 
Fixed in Version3.5.3 
Summary0002411: Native Path Mapping is not applied to the initial fileuri in the init packet
Description

Expected behavior:
When Native Path Mapping is enabled, Xdebug should apply the configured mapping to the initial DBGp debug-init request,
so the IDE receives the mapped file URI in the <init> packet.

According to https://xdebug.org/docs/all_settings this also seems to be the expected behavior:
"The fileuri attribute lists the entry point of your application, which can be useful to compare to breakpoint_set commands to see if path mappings are set-up correctly."

Actual behavior:
Xdebug does not apply Native Path Mapping to the initial DBGp fileuri. It sends the unmapped path in the <init> packet.
All paths send after the <init> packet are correct / rewritten.

Steps To Reproduce

Step 1 - Relevant Xdebug settings:
xdebug.path_mapping=1
xdebug.log=/tmp/xdebug.log
xdebug.log_level=10

Step 2 - Map file (/workspace/.xdebug/project.map):
/workspace/ = /home/chris/project-path-on-host-machine/

Step 3 - PHP script (/workspace/public/index.php):
<?php
echo "Hello world";

Step 4 - Start a DBGp listener / IDE and trigger a debug request

Step 5 - Inspect the init packet in /tmp/xdebug.log

Additional Information
  • My host with PhpStorm as the Xdebug listener is running Ubuntu 24.04.
  • The PHP application runs in a docker rootless container. Ubuntu 24.04 is used as the base image.
  • The attachment contains a minimal patch for Xdebug which fixes the issue for me. This is just a PoC created by AI, I have no experience with C.
  • Thanks for your amazing work!

php -v:
PHP 8.5.3 (cli) (built: Feb 13 2026 16:01:19) (NTS)
Copyright (c) The PHP Group
Built by Debian
Zend Engine v4.5.3, Copyright (c) Zend Technologies
with Xdebug v3.5.1, Copyright (c) 2002-2026, by Derick Rethans
with Zend OPcache v8.5.3, Copyright (c), by Zend Technologies

TagsNo tags attached.
Operating SystemUbuntu 24.04
PHP Version8.5.0-8.5.4

Activities