View Issue Details

IDProjectCategoryView StatusLast Update
0001365XdebugStep Debuggingpublic2020-03-12 17:36
Reporterrusbik92 Assigned Toderick  
PrioritynoneSeverityfeatureReproducibilityN/A
Status closedResolutionreopened 
PlatformLinuxOSUbuntuOS Version16.04
Product Version2.4.1 
Fixed in Version2.5.0 
Summary0001365: Allow remote_connect_back to be set through XDEBUG_CONFIG
Description

XDEBUG_CONFIG is ignoring remote_connect_back setting, please look at reproduce steps.

Steps To Reproduce

$ php -i | grep remote_connect_back

xdebug.remote_connect_back => Off => Off

$ export XDEBUG_CONFIG="remote_connect_back=1"
$ echo $XDEBUG_CONFIG

remote_connect_back=1

$ php -i | grep remote_connect_back

xdebug.remote_connect_back => Off => Off
XDEBUG_CONFIG => remote_connect_back=1
_SERVER["XDEBUG_CONFIG"] => remote_connect_back=1

TagsNo tags attached.
Operating SystemUbuntu
PHP Version7.0.10-7.0.14

Activities

derick

2016-11-20 22:32

administrator   ~0003767

Only a few INI settings for Xdebug are supported through XDEBUG_CONFIG. remote_connect_back isn't one of them. What make you think (documentation, for example) that this was supported?

rusbik92

2016-11-21 07:30

reporter   ~0003770

Well, documentation says:

When running the script from the command line you need to set an environment variable, like:
export XDEBUG_CONFIG="idekey=session_name"
php myscript.php
You can also configure the xdebug.remote_host, xdebug.remote_port, xdebug.remote_mode and xdebug.remote_handler in this same environment variable as long as you separate the values by a space:
export XDEBUG_CONFIG="idekey=session_name remote_host=localhost profiler_enable=1"
All settings that you can set through the XDEBUG_CONFIG setting can also be set with normal php.ini settings.

I thought, that if documentation says, that xdebug.remote_host, xdebug.remote_port, xdebug.remote_mode and xdebug.remote_handler can be set in XDEBUG_CONFIG, but also profiler_enable usage mentioned in example I can set something else in XDEBUG_CONFIG, for example remote_connect_back (that was extremely useful in my situation).

But why, for god sake, this parameter was not supported? I can understand, that whatever trace_options is not so important for that, but remote_connect_back should be there.

derick

2016-11-22 23:25

administrator   ~0003773

Hi!

Xdebug has over 50 settings, and each of them would need to be hardcoded in
the xdebug_env_config function in xdebug.c to support this. As PHP already
allows configuration through passing -doption=value on the command line, there
must be a large advantage for the setting to be configurable through the
XDEBUG_CONFIG environment variable for me to want to add it there.

The original intention for allowing configuration settings to be made through
an environment variable was to allow IDEs to set up a known state to allow
for debugging. This got later extended to triggering profiling and tracing
as well. As xdebug.remote_connect_back puts the debugger in an unstable
state (as the IP address to connect to can change away from what the IDE
expects), this setting was not included.

cheers,
Derick

rusbik92

2016-11-24 14:28

reporter   ~0003791

Last edited: 2016-11-24 14:31

Excuse me, but i have to reopen it to clarify, why this feature is important for my situation.
I have docker container with php+xdebug in it. Xdebug configured with remote_connect_back=1 in php.ini and when i start container on Linux machine all is working. But when i start it on Windows machine, there is a problem between Hyper-v virtual adapter and docker network, well, xdebug cannot refer to docker adapter's IP, because tcp port is not forwarded via Hyper-v. So the only way to make it work - is to somehow set xdebug remote_connect_back=0 and hardcode remote_host to host IP (developer just need to set env variable XDEBUG_CONFIG=192.168.0.23, where 192.168.0.23 - his machine's IP). Well, container can take env variable value from host machine and use it inside itself.
Yep, this is Windows specific issue and the main goal was to make windows developers (they are in minority) in our company to do some workaround instead of linux users (because we can make all users to set XDEBUG_CONFIG=192.168.0.x and it will work).

derick

2016-12-04 17:04

administrator   ~0003920

Makes sense. I've added it to 2.5.0RC2.

Issue History

Date Modified Username Field Change
2016-11-18 11:57 rusbik92 New Issue
2016-11-20 22:32 derick Note Added: 0003767
2016-11-20 22:32 derick Assigned To => derick
2016-11-20 22:32 derick Status new => feedback
2016-11-21 07:30 rusbik92 Note Added: 0003770
2016-11-21 07:30 rusbik92 Status feedback => assigned
2016-11-22 23:25 derick Note Added: 0003773
2016-11-22 23:25 derick Status assigned => resolved
2016-11-22 23:25 derick Resolution open => won't fix
2016-11-24 14:28 rusbik92 Note Added: 0003791
2016-11-24 14:28 rusbik92 Status resolved => feedback
2016-11-24 14:28 rusbik92 Resolution won't fix => reopened
2016-11-24 14:31 rusbik92 Note Edited: 0003791
2016-12-04 17:04 derick Note Added: 0003920
2016-12-04 17:04 derick Status feedback => closed
2016-12-04 17:04 derick Category Remote Debugging => Feature/Change request
2016-12-04 17:04 derick Fixed in Version => 2.5.0RC2
2016-12-04 17:04 derick Summary remote_connect_back setting is ignored in XDEBUG_CONFIG => Allow remote_connect_back to be set through XDEBUG_CONFIG
2016-12-04 17:04 derick Steps to Reproduce Updated
2016-12-04 18:33 derick Fixed in Version 2.5.0RC2 => 2.5.0
2020-03-12 16:55 derick Severity minor => feature
2020-03-12 17:36 derick Category Feature/Change request => Step Debugging