title: Xdebug, cannot accept external xdebug connection. Local value overwriting master
body: <p>I've been trying to set up xdebug for PHP CLI commands. I already have it working just fine for debugging Apache 2 (browser/API connections). The server is setup through Vagrant. So I copied over some xdebug settings to my <code>cli/php.ini</code></p>
  
  <pre><code>[xdebug]
  zend_extension=xdebug.so
  xdebug.remote_connect_back=1
  xdebug.remote_enable=1
  xdebug.remote_autostart=1
  xdebug.remote_port=9000
  xdebug.remote_host=10.0.2.2
  xdebug.extended_info=1
  xdebug.idekey="PHPSTORM"
  </code></pre>
  
  <p>And I setup a bunch of addresses in my IDE (PhpStorm)</p>
  
  <p><a href="https://i.stack.imgur.com/X3ivI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X3ivI.png" alt="enter image description here"></a></p>
  
  <p>Now when I attempt to use it most of the time nothing happens, but the first time I tried it yesterday and first thing this morning it gave me the message</p>
  
  <blockquote>
    <p>Cannot accept external Xdebug connection: Cannot evaluate expression 'isset($_SERVER['PHP_IDE_CONFIG'])'.</p>
  </blockquote>
  
  <p>I also tried adding a <code>phpinfo()</code> call to my code and then calling it from the terminal piping it to <code>grep xdebug</code>. This gave me the following which shows the local value => master value. I'm concerned by the <code>xdebug.remote_host</code> value which appears to have an overwritten local value of 'localhost' but I have no idea how this is happening.</p>
  
  <pre><code>xdebug support =&gt; enabled
  xdebug.auto_trace =&gt; Off =&gt; Off
  xdebug.cli_color =&gt; 0 =&gt; 0
  xdebug.collect_assignments =&gt; Off =&gt; Off
  xdebug.collect_includes =&gt; On =&gt; On
  xdebug.collect_params =&gt; 0 =&gt; 0
  xdebug.collect_return =&gt; Off =&gt; Off
  xdebug.collect_vars =&gt; Off =&gt; Off
  xdebug.coverage_enable =&gt; On =&gt; On
  xdebug.default_enable =&gt; On =&gt; On
  xdebug.dump.COOKIE =&gt; no value =&gt; no value
  xdebug.dump.ENV =&gt; no value =&gt; no value
  xdebug.dump.FILES =&gt; no value =&gt; no value
  xdebug.dump.GET =&gt; no value =&gt; no value
  xdebug.dump.POST =&gt; no value =&gt; no value
  xdebug.dump.REQUEST =&gt; no value =&gt; no value
  xdebug.dump.SERVER =&gt; no value =&gt; no value
  xdebug.dump.SESSION =&gt; no value =&gt; no value
  xdebug.dump_globals =&gt; On =&gt; On
  xdebug.dump_once =&gt; On =&gt; On
  xdebug.dump_undefined =&gt; Off =&gt; Off
  xdebug.extended_info =&gt; On =&gt; On
  xdebug.file_link_format =&gt; no value =&gt; no value
  xdebug.filename_format =&gt; no value =&gt; no value
  xdebug.force_display_errors =&gt; Off =&gt; Off
  xdebug.force_error_reporting =&gt; 0 =&gt; 0
  xdebug.gc_stats_enable =&gt; Off =&gt; Off
  xdebug.gc_stats_output_dir =&gt; /tmp =&gt; /tmp
  xdebug.gc_stats_output_name =&gt; gcstats.%p =&gt; gcstats.%p
  xdebug.halt_level =&gt; 0 =&gt; 0
  xdebug.idekey =&gt; PHPSTORM =&gt; PHPSTORM
  xdebug.max_nesting_level =&gt; 256 =&gt; 256
  xdebug.max_stack_frames =&gt; -1 =&gt; -1
  xdebug.overload_var_dump =&gt; 2 =&gt; 2
  xdebug.profiler_aggregate =&gt; Off =&gt; Off
  xdebug.profiler_append =&gt; Off =&gt; Off
  xdebug.profiler_enable =&gt; Off =&gt; Off
  xdebug.profiler_enable_trigger =&gt; Off =&gt; Off
  xdebug.profiler_enable_trigger_value =&gt; no value =&gt; no value
  xdebug.profiler_output_dir =&gt; /tmp =&gt; /tmp
  xdebug.profiler_output_name =&gt; cachegrind.out.%p =&gt; cachegrind.out.%p
  xdebug.remote_addr_header =&gt; no value =&gt; no value
  xdebug.remote_autostart =&gt; On =&gt; On
  xdebug.remote_connect_back =&gt; On =&gt; On
  xdebug.remote_cookie_expire_time =&gt; 3600 =&gt; 3600
  xdebug.remote_enable =&gt; On =&gt; On
  xdebug.remote_handler =&gt; dbgp =&gt; dbgp
  xdebug.remote_host =&gt; localhost =&gt; 10.0.2.2
  xdebug.remote_log =&gt; no value =&gt; no value
  xdebug.remote_mode =&gt; req =&gt; req
  xdebug.remote_port =&gt; 9000 =&gt; 9000
  xdebug.remote_timeout =&gt; 200 =&gt; 200
  xdebug.scream =&gt; Off =&gt; Off
  xdebug.show_error_trace =&gt; Off =&gt; Off
  xdebug.show_exception_trace =&gt; Off =&gt; Off
  xdebug.show_local_vars =&gt; Off =&gt; Off
  xdebug.show_mem_delta =&gt; Off =&gt; Off
  xdebug.trace_enable_trigger =&gt; Off =&gt; Off
  xdebug.trace_enable_trigger_value =&gt; no value =&gt; no value
  xdebug.trace_format =&gt; 0 =&gt; 0
  xdebug.trace_options =&gt; 0 =&gt; 0
  xdebug.trace_output_dir =&gt; /tmp =&gt; /tmp
  xdebug.trace_output_name =&gt; trace.%c =&gt; trace.%c
  xdebug.var_display_max_children =&gt; 128 =&gt; 128
  xdebug.var_display_max_data =&gt; 512 =&gt; 512
  xdebug.var_display_max_depth =&gt; 3 =&gt; 3
  </code></pre>
  
  <p>Thanks for any help</p>