MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001365XdebugFeature/Change requestpublic2016-11-18 11:572016-12-04 18:33
Reporterrusbik92 
Assigned Toderick 
PrioritynoneSeverityminorReproducibilityN/A
StatusclosedResolutionreopened 
PlatformLinuxOSUbuntuOS Version16.04
Product Version2.4.1 
Target VersionFixed in Version2.5.0 
Summary0001365: Allow remote_connect_back to be set through XDEBUG_CONFIG
DescriptionXDEBUG_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
Attached Files

- Relationships

-  Notes
(0003767)
derick (administrator)
2016-11-20 22:32

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?
(0003770)
rusbik92 (reporter)
2016-11-21 07:30

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.
(0003773)
derick (administrator)
2016-11-22 23:25

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
(0003791)
rusbik92 (reporter)
2016-11-24 14:28
edited on: 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).

(0003920)
derick (administrator)
2016-12-04 17:04

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 View Revisions
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 View Revisions
2016-12-04 18:33 derick Fixed in Version 2.5.0RC2 => 2.5.0


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker