How to fix "To fix it set server name by environment variable PHP_IDE_CONFIG and restart debug session."?

Viewed 2237

PhpStorm xdebug can't find file when connection comes from docker container

Tried by this. When added PHP_IDE_CONFIG to my docker, then xdebug did not even stop. Before adding that env variable, xdebug at least stops but I am not able to step through lines, it just shows an error:

Cannot find file '/var/www/pmp-api/bin/console' locally. To fix it set server name by environment variable PHP_IDE_CONFIG and restart debug session.

I have enter image description here

#- PHP_IDE_CONFIG="serverName=pmpapi.local"
      - XDEBUG_CONFIG=idekey=PHPSTORM

Later I commented PHP_IDE_CONFIG and added XDEBUG_CONFIG . PHPSTORM is set as idekey in PhpStorm.

Also tried in Nginx config server_name _;

Also: xdebug.extended_info = 1

Why can this be not working still?

Update

When there is no PHP_IDE_CONFIG variable:

[17] Log opened at 2021-11-16 18:51:45
[17] I: Checking remote connect back address.
[17] I: Checking header 'HTTP_X_FORWARDED_FOR'.
[17] I: Checking header 'REMOTE_ADDR'.
[17] W: Remote address not found, connecting to configured address/port: 192.168.31.26:9001. :-|
[17] I: Connected to client. :-)
[17] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///var/www/pmp-api/bin/console" language="PHP" xdebug:language_version="7.2.31" protocol_version="1.0" appid="17"><engine version="2.9.8"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2020 by Derick Rethans]]></copyright></init>

[17] <- eval -i 1 -- KHN0cmluZykoaW5pX2dldCgneGRlYnVnLmNvdmVyYWdlX2VuYWJsZScpLic7Jy5pbmlfZ2V0KCd4ZGVidWcucHJvZmlsZXJfZW5hYmxlJykuJzsnLmluaV9nZXQoJ3hkZWJ1Zy5yZW1vdGVfYXV0b3N0YXJ0JykuJzsnLmluaV9nZXQoJ3hkZWJ1Zy5yZW1vdGVfY29ubmVjdF9iYWNrJykuJzsnLmluaV9nZXQoJ3hkZWJ1Zy5yZW1vdGVfbW9kZScpKQ==
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="1"><property type="string" size="11" encoding="base64"><![CDATA[MTswOzE7MTtyZXE=]]></property></response>

[17] <- feature_set -i 2 -n show_hidden -v 1
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="show_hidden" success="1"></response>

[17] <- feature_set -i 3 -n max_depth -v 1
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_depth" success="1"></response>

[17] <- feature_set -i 4 -n max_children -v 100
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="4" feature="max_children" success="1"></response>

[17] <- feature_set -i 5 -n extended_properties -v 1
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="5" feature="extended_properties" success="1"></response>

[17] <- feature_set -i 6 -n notify_ok -v 1
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="6" feature="notify_ok" success="1"></response>

[17] <- feature_set -i 7 -n resolved_breakpoints -v 1
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="7" feature="resolved_breakpoints" success="1"></response>

[17] <- stdout -i 8 -c 1
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stdout" transaction_id="8" success="1"></response>

[17] <- status -i 9
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="status" transaction_id="9" status="starting" reason="ok"></response>

[17] <- step_into -i 10
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="10" status="break" reason="ok"><xdebug:message filename="file:///var/www/pmp-api/bin/console" lineno="9"></xdebug:message></response>

[17] <- eval -i 11 -- aXNzZXQoJF9TRVJWRVJbJ1BIUF9JREVfQ09ORklHJ10p
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="11"><property type="bool"><![CDATA[0]]></property></response>

[17] <- eval -i 12 -- aXNzZXQoJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10p
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="12"><property type="bool"><![CDATA[0]]></property></response>

[17] <- eval -i 13 -- aXNzZXQoJF9TRVJWRVJbJ1NTSF9DT05ORUNUSU9OJ10p
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="13"><property type="bool"><![CDATA[0]]></property></response>

[17] <- eval -i 14 -- aXNzZXQoJF9TRVJWRVJbJ1NFUlZFUl9BRERSJ10p
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="14"><property type="bool"><![CDATA[0]]></property></response>

[17] <- breakpoint_set -i 15 -t line -f file:///home/agmis/projects/pmp-api/src/Service/Invoice/InvoiceService.php -n 70
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="15" id="170001" resolved="unresolved"></response>

[17] <- breakpoint_set -i 16 -t line -f file:///home/agmis/projects/pmp-api/src/Service/Order/OrderService.php -n 78
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="16" id="170002" resolved="unresolved"></response>

[17] <- breakpoint_set -i 17 -t line -f file:///home/agmis/projects/pmp-api/src/Repository/OrderRepository.php -n 360
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="17" id="170003" resolved="unresolved"></response>

[17] <- breakpoint_set -i 18 -t line -f file:///home/agmis/projects/pmp-api/src/Service/Order/OrderService.php -n 79
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="18" id="170004" resolved="unresolved"></response>

[17] <- breakpoint_set -i 19 -t line -f file:///home/agmis/projects/pmp-api/src/Controller/v1/Orders/OrderController.php -n 322
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="19" id="170005" resolved="unresolved"></response>

[17] <- breakpoint_set -i 20 -t line -f file:///home/agmis/projects/pmp-api/src/Repository/OrderRepository.php -n 625
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="20" id="170006" resolved="unresolved"></response>

[17] <- breakpoint_set -i 21 -t line -f file:///home/agmis/projects/pmp-api/src/Service/Order/OrderService.php -n 64
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="21" id="170007" resolved="unresolved"></response>

[17] <- breakpoint_set -i 22 -t line -f file:///home/agmis/projects/pmp-api/src/Controller/v2/Orders/OrderController.php -n 77
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="22" id="170008" resolved="unresolved"></response>

[17] <- breakpoint_set -i 23 -t line -f file:///home/agmis/projects/pmp-api/src/Service/Validator/CreateOrderValidator.php -n 139
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="23" id="170009" resolved="unresolved"></response>

[17] <- breakpoint_set -i 24 -t line -f file:///home/agmis/projects/pmp-api/src/Controller/v1/Orders/OrderController.php -n 207
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="24" id="170010" resolved="unresolved"></response>

[17] <- breakpoint_set -i 25 -t line -f file:///home/agmis/projects/pmp-api/bin/console -n 11
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="25" id="170011" resolved="unresolved"></response>

[17] <- breakpoint_set -i 26 -t line -f file:///home/agmis/projects/pmp-api/src/Service/Order/OrderService.php -n 74
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="26" id="170012" resolved="unresolved"></response>

[17] <- breakpoint_set -i 27 -t line -f file:///home/agmis/projects/pmp-api/src/Controller/v1/Orders/OrderController.php -n 451
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="27" id="170013" resolved="unresolved"></response>

[17] <- breakpoint_set -i 28 -t line -f file:///home/agmis/projects/pmp-api/src/Service/Order/OrderService.php -n 72
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="28" id="170014" resolved="unresolved"></response>

[17] <- breakpoint_set -i 29 -t line -f file:///home/agmis/projects/pmp-api/src/Controller/v2/Users/SellerController.php -n 380
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="29" id="170015" resolved="unresolved"></response>

[17] <- breakpoint_set -i 30 -t line -f file:///home/agmis/projects/pmp-api/src/Controller/v2/Users/SellerController.php -n 332
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="30" id="170016" resolved="unresolved"></response>

[17] <- breakpoint_set -i 31 -t line -f file:///home/agmis/projects/pmp-api/src/Repository/OrderRepository.php -n 359
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="31" id="170017" resolved="unresolved"></response>

[17] <- breakpoint_set -i 32 -t line -f file:///home/agmis/projects/pmp-api/src/Controller/v2/Users/SellerController.php -n 346
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="32" id="170018" resolved="unresolved"></response>

[17] <- stack_get -i 33
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="33"><stack where="{main}" level="0" type="file" filename="file:///var/www/pmp-api/bin/console" lineno="9"></stack></response>

[17] <- stack_get -i 34
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="34"><stack where="{main}" level="0" type="file" filename="file:///var/www/pmp-api/bin/console" lineno="9"></stack></response>

[17] <- context_names -i 35
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="35"><context name="Locals" id="0"></context><context name="Superglobals" id="1"></context><context name="User defined constants" id="2"></context></response>

[17] <- context_get -i 36 -d 0 -c 0
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="36" context="0"><property name="$application" fullname="$application" type="uninitialized"></property><property name="$env" fullname="$env" type="uninitialized"></property><property name="$input" fullname="$input" type="uninitialized"></property><property name="$kernel" fullname="$kernel" type="uninitialized"></property></response>

[17] <- context_get -i 37 -d 0 -c 1
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="37" context="1"><property name="$_COOKIE" fullname="$_COOKIE" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_ENV" fullname="$_ENV" type="array" children="1" numchildren="21" page="0" pagesize="100"><property name="PHP_EXTRA_CONFIGURE_ARGS" fullname="$_ENV[&quot;PHP_EXTRA_CONFIGURE_ARGS&quot;]" type="string" size="77" encoding="base64"><![CDATA[LS1lbmFibGUtZnBtIC0td2l0aC1mcG0tdXNlcj13d3ctZGF0YSAtLXdpdGgtZnBtLWdyb3VwPXd3dy1kYXRhIC0tZGlzYWJsZS1jZ2k=]]></property><property name="HOSTNAME" fullname="$_ENV[&quot;HOSTNAME&quot;]" type="string" size="12" encoding="base64"><![CDATA[Y2ExZmMwYzFjYjEz]]></property><property name="PHP_INI_DIR" fullname="$_ENV[&quot;PHP_INI_DIR&quot;]" type="string" size="18" encoding="base64"><![CDATA[L3Vzci9sb2NhbC9ldGMvcGhw]]></property><property name="SHLVL" fullname="$_ENV[&quot;SHLVL&quot;]" type="string" size="1" encoding="base64"><![CDATA[MQ==]]></property><property name="HOME" fullname="$_ENV[&quot;HOME&quot;]" type="string" size="5" encoding="base64"><![CDATA[L3Jvb3Q=]]></property><property name="PHP_LDFLAGS" fullname="$_ENV[&quot;PHP_LDFLAGS&quot;]" type="string" size="12" encoding="base64"><![CDATA[LVdsLC1PMSAtcGll]]></property><property name="PHP_CFLAGS" fullname="$_ENV[&quot;PHP_CFLAGS&quot;]" type="string" size="83" encoding="base64"><![CDATA[LWZzdGFjay1wcm90ZWN0b3Itc3Ryb25nIC1mcGljIC1mcGllIC1PMiAtRF9MQVJHRUZJTEVfU09VUkNFIC1EX0ZJTEVfT0ZGU0VUX0JJVFM9NjQ=]]></property><property name="PHP_MD5" fullname="$_ENV[&quot;PHP_MD5&quot;]" type="string" size="0" encoding="base64"><![CDATA[]]></property><property name="PHP_VERSION" fullname="$_ENV[&quot;PHP_VERSION&quot;]" type="string" size="6" encoding="base64"><![CDATA[Ny4yLjMx]]></property><property name="GPG_KEYS" fullname="$_ENV[&quot;GPG_KEYS&quot;]" type="string" size="81" encoding="base64"><![CDATA[MTcyOUY4MzkzOERBNDRFMjdCQTBGNEQzREJEQjM5NzQ3MEQxMjE3MiBCMUI0NEQ4RjAyMUU0RTJENjAyMUU5OTVEQzlGRjhEM0VFNUFGMjdG]]></property><property name="PHP_CPPFLAGS" fullname="$_ENV[&quot;PHP_CPPFLAGS&quot;]" type="string" size="83" encoding="base64"><![CDATA[LWZzdGFjay1wcm90ZWN0b3Itc3Ryb25nIC1mcGljIC1mcGllIC1PMiAtRF9MQVJHRUZJTEVfU09VUkNFIC1EX0ZJTEVfT0ZGU0VUX0JJVFM9NjQ=]]></property><property name="PHP_ASC_URL" fullname="$_ENV[&quot;PHP_ASC_URL&quot;]" type="string" size="55" encoding="base64"><![CDATA[aHR0cHM6Ly93d3cucGhwLm5ldC9kaXN0cmlidXRpb25zL3BocC03LjIuMzEudGFyLnh6LmFzYw==]]></property><property name="PHP_URL" fullname="$_ENV[&quot;PHP_URL&quot;]" type="string" size="51" encoding="base64"><![CDATA[aHR0cHM6Ly93d3cucGhwLm5ldC9kaXN0cmlidXRpb25zL3BocC03LjIuMzEudGFyLnh6]]></property><property name="TERM" fullname="$_ENV[&quot;TERM&quot;]" type="string" size="5" encoding="base64"><![CDATA[eHRlcm0=]]></property><property name="PATH" fullname="$_ENV[&quot;PATH&quot;]" type="string" size="60" encoding="base64"><![CDATA[L3Vzci9sb2NhbC9zYmluOi91c3IvbG9jYWwvYmluOi91c3Ivc2JpbjovdXNyL2Jpbjovc2JpbjovYmlu]]></property><property name="SSH_AUTH_SOCK" fullname="$_ENV[&quot;SSH_AUTH_SOCK&quot;]" type="string" size="10" encoding="base64"><![CDATA[L3NzaC1hZ2VudA==]]></property><property name="REDIS_HOST" fullname="$_ENV[&quot;REDIS_HOST&quot;]" type="string" size="5" encoding="base64"><![CDATA[cmVkaXM=]]></property><property name="APP_ENV" fullname="$_ENV[&quot;APP_ENV&quot;]" type="string" size="3" encoding="base64"><![CDATA[ZGV2]]></property><property type="string" size="78"><name encoding="base64"><![CDATA[UEhQSVpFX0RFUFM=]]></name><fullname encoding="base64"><![CDATA[JF9FTlZbIlBIUElaRV9ERVBTIl0=]]></fullname><value encoding="base64"><![CDATA[YXV0b2NvbmYgCQlkcGtnLWRldiBkcGtnIAkJZmlsZSAJCWcrKyAJCWdjYyAJCWxpYmMtZGV2IAkJbWFrZSAJCXBrZ2NvbmYgCQlyZTJj]]></value></property><property name="PWD" fullname="$_ENV[&quot;PWD&quot;]" type="string" size="16" encoding="base64"><![CDATA[L3Zhci93d3cvcG1wLWFwaQ==]]></property><property name="PHP_SHA256" fullname="$_ENV[&quot;PHP_SHA256&quot;]" type="string" size="64" encoding="base64"><![CDATA[OGJlYWE2MzRiYjg3OGE5NmFmOWJjODY0MzgxMWVhNDY5NzNmNWY0MWFkMmJmYjZhYjRjZmQyOTBlNWEzOTgwNg==]]></property></property><property name="$_FILES" fullname="$_FILES" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_GET" fullname="$_GET" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_POST" fullname="$_POST" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_REQUEST" fullname="$_REQUEST" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_SERVER" fullname="$_SERVER" type="array" children="1" numchildren="30" page="0" pagesize="100"><property name="PHP_EXTRA_CONFIGURE_ARGS" fullname="$_SERVER[&quot;PHP_EXTRA_CONFIGURE_ARGS&quot;]" type="string" size="77" encoding="base64"><![CDATA[LS1lbmFibGUtZnBtIC0td2l0aC1mcG0tdXNlcj13d3ctZGF0YSAtLXdpdGgtZnBtLWdyb3VwPXd3dy1kYXRhIC0tZGlzYWJsZS1jZ2k=]]></property><property name="HOSTNAME" fullname="$_SERVER[&quot;HOSTNAME&quot;]" type="string" size="12" encoding="base64"><![CDATA[Y2ExZmMwYzFjYjEz]]></property><property name="PHP_INI_DIR" fullname="$_SERVER[&quot;PHP_INI_DIR&quot;]" type="string" size="18" encoding="base64"><![CDATA[L3Vzci9sb2NhbC9ldGMvcGhw]]></property><property name="SHLVL" fullname="$_SERVER[&quot;SHLVL&quot;]" type="string" size="1" encoding="base64"><![CDATA[MQ==]]></property><property name="HOME" fullname="$_SERVER[&quot;HOME&quot;]" type="string" size="5" encoding="base64"><![CDATA[L3Jvb3Q=]]></property><property name="PHP_LDFLAGS" fullname="$_SERVER[&quot;PHP_LDFLAGS&quot;]" type="string" size="12" encoding="base64"><![CDATA[LVdsLC1PMSAtcGll]]></property><property name="PHP_CFLAGS" fullname="$_SERVER[&quot;PHP_CFLAGS&quot;]" type="string" size="83" encoding="base64"><![CDATA[LWZzdGFjay1wcm90ZWN0b3Itc3Ryb25nIC1mcGljIC1mcGllIC1PMiAtRF9MQVJHRUZJTEVfU09VUkNFIC1EX0ZJTEVfT0ZGU0VUX0JJVFM9NjQ=]]></property><property name="PHP_MD5" fullname="$_SERVER[&quot;PHP_MD5&quot;]" type="string" size="0" encoding="base64"><![CDATA[]]></property><property name="PHP_VERSION" fullname="$_SERVER[&quot;PHP_VERSION&quot;]" type="string" size="6" encoding="base64"><![CDATA[Ny4yLjMx]]></property><property name="GPG_KEYS" fullname="$_SERVER[&quot;GPG_KEYS&quot;]" type="string" size="81" encoding="base64"><![CDATA[MTcyOUY4MzkzOERBNDRFMjdCQTBGNEQzREJEQjM5NzQ3MEQxMjE3MiBCMUI0NEQ4RjAyMUU0RTJENjAyMUU5OTVEQzlGRjhEM0VFNUFGMjdG]]></property><property name="PHP_CPPFLAGS" fullname="$_SERVER[&quot;PHP_CPPFLAGS&quot;]" type="string" size="83" encoding="base64"><![CDATA[LWZzdGFjay1wcm90ZWN0b3Itc3Ryb25nIC1mcGljIC1mcGllIC1PMiAtRF9MQVJHRUZJTEVfU09VUkNFIC1EX0ZJTEVfT0ZGU0VUX0JJVFM9NjQ=]]></property><property name="PHP_ASC_URL" fullname="$_SERVER[&quot;PHP_ASC_URL&quot;]" type="string" size="55" encoding="base64"><![CDATA[aHR0cHM6Ly93d3cucGhwLm5ldC9kaXN0cmlidXRpb25zL3BocC03LjIuMzEudGFyLnh6LmFzYw==]]></property><property name="PHP_URL" fullname="$_SERVER[&quot;PHP_URL&quot;]" type="string" size="51" encoding="base64"><![CDATA[aHR0cHM6Ly93d3cucGhwLm5ldC9kaXN0cmlidXRpb25zL3BocC03LjIuMzEudGFyLnh6]]></property><property name="TERM" fullname="$_SERVER[&quot;TERM&quot;]" type="string" size="5" encoding="base64"><![CDATA[eHRlcm0=]]></property><property name="PATH" fullname="$_SERVER[&quot;PATH&quot;]" type="string" size="60" encoding="base64"><![CDATA[L3Vzci9sb2NhbC9zYmluOi91c3IvbG9jYWwvYmluOi91c3Ivc2JpbjovdXNyL2Jpbjovc2JpbjovYmlu]]></property><property name="SSH_AUTH_SOCK" fullname="$_SERVER[&quot;SSH_AUTH_SOCK&quot;]" type="string" size="10" encoding="base64"><![CDATA[L3NzaC1hZ2VudA==]]></property><property name="REDIS_HOST" fullname="$_SERVER[&quot;REDIS_HOST&quot;]" type="string" size="5" encoding="base64"><![CDATA[cmVkaXM=]]></property><property name="APP_ENV" fullname="$_SERVER[&quot;APP_ENV&quot;]" type="string" size="3" encoding="base64"><![CDATA[ZGV2]]></property><property type="string" size="78"><name encoding="base64"><![CDATA[UEhQSVpFX0RFUFM=]]></name><fullname encoding="base64"><![CDATA[JF9TRVJWRVJbIlBIUElaRV9ERVBTIl0=]]></fullname><value encoding="base64"><![CDATA[YXV0b2NvbmYgCQlkcGtnLWRldiBkcGtnIAkJZmlsZSAJCWcrKyAJCWdjYyAJCWxpYmMtZGV2IAkJbWFrZSAJCXBrZ2NvbmYgCQlyZTJj]]></value></property><property name="PWD" fullname="$_SERVER[&quot;PWD&quot;]" type="string" size="16" encoding="base64"><![CDATA[L3Zhci93d3cvcG1wLWFwaQ==]]></property><property name="PHP_SHA256" fullname="$_SERVER[&quot;PHP_SHA256&quot;]" type="string" size="64" encoding="base64"><![CDATA[OGJlYWE2MzRiYjg3OGE5NmFmOWJjODY0MzgxMWVhNDY5NzNmNWY0MWFkMmJmYjZhYjRjZmQyOTBlNWEzOTgwNg==]]></property><property name="PHP_SELF" fullname="$_SERVER[&quot;PHP_SELF&quot;]" type="string" size="11" encoding="base64"><![CDATA[YmluL2NvbnNvbGU=]]></property><property name="SCRIPT_NAME" fullname="$_SERVER[&quot;SCRIPT_NAME&quot;]" type="string" size="11" encoding="base64"><![CDATA[YmluL2NvbnNvbGU=]]></property><property name="SCRIPT_FILENAME" fullname="$_SERVER[&quot;SCRIPT_FILENAME&quot;]" type="string" size="11" encoding="base64"><![CDATA[YmluL2NvbnNvbGU=]]></property><property name="PATH_TRANSLATED" fullname="$_SERVER[&quot;PATH_TRANSLATED&quot;]" type="string" size="11" encoding="base64"><![CDATA[YmluL2NvbnNvbGU=]]></property><property name="DOCUMENT_ROOT" fullname="$_SERVER[&quot;DOCUMENT_ROOT&quot;]" type="string" size="0" encoding="base64"><![CDATA[]]></property><property name="REQUEST_TIME_FLOAT" fullname="$_SERVER[&quot;REQUEST_TIME_FLOAT&quot;]" type="float"><![CDATA[1637088705.79]]></property><property name="REQUEST_TIME" fullname="$_SERVER[&quot;REQUEST_TIME&quot;]" type="int"><![CDATA[1637088705]]></property><property name="argv" fullname="$_SERVER[&quot;argv&quot;]" type="array" children="1" numchildren="1"></property><property name="argc" fullname="$_SERVER[&quot;argc&quot;]" type="int"><![CDATA[1]]></property></property></response>

[17] <- context_get -i 38 -d 0 -c 2
[17] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="38" context="2"></response>

It stops and but not at breakpoints.

When there is

PHP_IDE_CONFIG="serverName=pmpapi.local"

[16] Log opened at 2021-11-16 18:41:18
[16] I: Checking remote connect back address.
[16] I: Checking header 'HTTP_X_FORWARDED_FOR'.
[16] I: Checking header 'REMOTE_ADDR'.
[16] W: Remote address not found, connecting to configured address/port: 192.168.128.11:9001. :-|
[16] W: Creating socket for '192.168.128.11:9001', poll success, but error: Operation in progress (29).
[16] E: Could not connect to client. :-(
[16] Log closed at 2021-11-16 18:41:18

so it does not even stop.

Update:

Tried today with PHP_IDE_CONFIG - does not stop, but connects. But script does not stop on breakpoints, just executes.

https://pastebin.com/Z6gUntTn

Why earlier ip could have been different - probably I have changed it.Sometimes my computer ip changes, so maybe I have changed because of that, can't remember. But now looks like it is correct.

In PhpStorm even log I see:

Cannot parse server name for external Xdebug connection. To fix it create environment variable PHP_IDE_CONFIG on the remote server. Windows: set PHP_IDE_CONFIG="serverName=SomeName" Linux / Mac OS X: export PHP_IDE_CONFIG="serverName=SomeName".

It feels like there is no such variable even if I add it. I do not add by exporting but I add in docker-compose.yml and build the container. Part of code how I add it:

  pmp-api-php:
    environment:
      - REDIS_HOST=redis
      - APP_ENV=dev
      - SSH_AUTH_SOCK=/ssh-agent
      - PHP_IDE_CONFIG="serverName=pmpapi.local" # net nesustoja
   

Interesting, when I exported same variable in docker container terminal as PhpStorm told - it started stopping at breakpoints.

When I removed PHP_IDE_CONFIG line from docker-compose.yml, rebuilt and exported again, it still works. Good. Not perfect, I wish I do not need to export each time that config. But at least it works. If you have a way to set so I do not need to export each time, probably after each start, it would be better. Thanks.

1 Answers

Check the log. Check if xdebug connects, if it tries to connect to correct ip. In my case it was trying to to connect to wrong ip. So needed to change this config to this value:

xdebug.remote_host=192.168.31.26

Next thing - PhpStorm started writing

Cannot parse server name for external Xdebug connection. To fix it create environment variable PHP_IDE_CONFIG on the remote server. Windows: set PHP_IDE_CONFIG="serverName=SomeName" Linux / Mac OS X: export PHP_IDE_CONFIG="serverName=SomeName".

So got in docker container and run the export. ServerName has to be same as Name field in PhpStorm config enter image description here

Related