PHPStorm picking up wrong index.php

Recently I was setting up Drupal development environment with docksal. I used traditional drupal composer setup (https://github.com/drupal-composer/drupal-project) so drupal is in the /web folder on the server.

I have mapped main root folder in PHP Storm

So I was really surprised when I started my debugging session and discovered some weird file being started.

Looks like PHP Storm tries to find first index.php it can find and then starts session like it is being debugged.

Solution for this is to map folder "web" and actual index.php so PHP Storm can find proper file easier.

As result proper index.php is displayed as being debugged.