title: IntelliJ, PhpStorm: Debugging with xdebug ignores XDEBUG_SESSION cookie
body: <p>I am trying to debug a Drupal website with the PHP plugin in Intellij (would be the same in PhpStorm).</p>
  
  <p>I have the following setup:</p>
  
  <p>Chrome Browser pointing to a localhost alias <code>mydomain.local</code> and the XDebug Helper extension is installed and set to Debug. In the <em>Developer Tools</em> under Cookies I can see that the <code>XDEBUG_SESSION</code> cookie is set to PHPSTORM.</p>
  
  <p>I have configured php with the xdebug plugin using the following settings:</p>
  
  <pre><code>xdebug.extended_info = 1
  xdebug.idekey = "PHPSTORM"
  xdebug.max_nesting_level = 500
  xdebug.remote_autostart = 1
  xdebug.remote_connect_back = 0
  xdebug.remote_enable = 1
  xdebug.remote_handler = dbgp
  xdebug.remote_host = 127.0.0.1
  xdebug.remote_mode = req
  xdebug.remote_port = 9000
  </code></pre>
  
  <p>In IntelliJ I have setup a Server pointing to <code>mydomain.local</code> and in the run configuration I am using that server and have set the Ide Key to <code>PHPSTORM</code>.</p>
  
  <p>Now the issue is this:</p>
  
  <p>If I enable <strong>Break at first line in PHP scripts</strong>, then the debugger immediately breaks at the first breakable location inside the <code>index.php</code>. If I disable that option, I get a warning that no breakpoint was hit, even though I have a break point set and I am certain that the code is being executed. The warning that I see looks like this:</p>
  
  <pre><code>Debug session was finished without being paused
  It may be caused by path mappings misconfiguration or not synchronized
  local and remote projects.
  To figure out the problem check path mappings configuration for 
  'mydomain.local' server at PHP|Servers or enable Break at first line in
  PHP scripts option (from Run menu).
  </code></pre>
  
  <p>Now if I explicitly use a URL with the following query parameter appended: <code>?XDEBUG_SESSION_START=PHPSTORM</code> then all my breakpoints are properly being breaked in IntelliJ.</p>
  
  <p><strong>Question:</strong> Why is the <code>XDEBUG_SESSION</code> cookie being ignored?</p>
  
  <p><strong>Update:</strong> Added my PHP and XDebug version output from <code>php -v</code>:</p>
  
  <pre><code>PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS )
  Copyright (c) 1997-2016 The PHP Group
  Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
      with Zend OPcache v7.0.8-0ubuntu0.16.04.3, Copyright (c) 1999-2016,
      by Zend Technologies
      with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans
  </code></pre>
  
  <p>and my Apache virtual host configuration:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      DocumentRoot /var/www/html/mydomain
      ServerName mydomain.local
      &lt;Directory /var/www/html/mydomain&gt;
          Options Indexes FollowSymLinks
          AllowOverride All
          Order allow,deny
          Allow from all
      &lt;/Directory&gt;
  
      ErrorLog /var/log/apache2/mydomain.log
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p><strong>Update 2:</strong>
  I have a php extension installed that is called <code>fpm</code>. I am not quite sure why its installed or if I need it. I think it was automatically installed with php. Could this be interfering?</p>