Configuring Xdebug with a Docker install

Hi there,

I was wondering if anyone else had come across this and been able to fix it.

I'm using PHPStorm with Xdebug and a Drupal/LAMP setup inside a Docker container. I've configured Xdebug to work with DBGp Proxy, and I've set up path mappings for a couple of key things (the index.php file, and the vendor directory, principally).

If I put some breaks in the code I then run the debugger (by clicking the green phone icon and refreshing my page in the browser) the debugger starts and I get some output in the debugger window. I can see the cookie and server variables, for example. However, I also get the following error:

  • Local path is /Users/myname/Projects/myrepo/web/web/index.php
  • Cannot find a local copy of the file on server /var/www/html/web/index.php

I'm perplexed by this because it's adding an uneccesary /web/ directory in the file path (the correct paths are /Users/myname/Projects/myrepo/web/index.php and /var/www/html/index.php) but I've got no idea where that's configured. Can anyone help me out?



Comment actions Permalink

You may want to configure mappings in "Languages & Frameworks | PHP | Servers".

A little bit more about it:

Comment actions Permalink

Gah! Actually you're completely right. I had followed the path mappings instructions you've provided, but I'd not actually mapped the correct paths.

Anyhow, thanks for getting back to me so quickly.



Please sign in to leave a comment.