Search code examples
phpdebuggingphpstormxdebugremote-debugging

Remote Xdebug with PhpStorm


On my remote server I have xdebug installed and I am doing a port forward from my server to my local machine in order to debug. The issue is that the request is coming in and the mapping for files is prompted but when I choose the corresponding file PHPStorm show me the

/var/www/html/index.php

like on the server. Does anyone have any idea how to fix this? I can complete my question with tech details if needed.

Update 1 https://imagebin.ca/v/3I2XzlNC7J8C


Solution

  • Take a look at this a little old, but still valid blog post. In short, you need to define an environment variable PHP_IDE_CONFIG that will tell PhpStorm to use a specific mapping config.

    For example, in Ubuntu you can do the following:

    $ export PHP_IDE_CONFIG="serverName=yourServerName"
    

    Instead of yourServerName you need to put the name of the server configuration that you defined in PhpStorm Servers Settings.