title: Can't get Xdebug to work (mac+PhpStorm+Laradock+Xdebug)
body: <p>I need to debug the code in my local environment.Accurately speaking, is a Laradock in my mac. But I tried it many times and failed.</p>
  
  <pre><code>Mac version MoJave 10.14.2
  Docker version 18.09.0, build 4d60db4
  Docker-compose version 1.23.2, build 1110ad01
  Laradock version(commit id) a03c225e279910b9393b5e95fbffe5081b9e5a95
  PhpStorm version  2018.1.1 Build #PS-181.4445.72
  </code></pre>
  
  <p>Xdebug status :</p>
  
  <pre><code>PHP 7.2.15 (cli) (built: Feb 21 2019 23:48:47) ( NTS )
  Copyright (c) 1997-2018 The PHP Group
  Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
      with Zend OPcache v7.2.15, Copyright (c) 1999-2018, by Zend Technologies
      with Xdebug v2.7.0, Copyright (c) 2002-2019, by Derick Rethans
  </code></pre>
  
  <p>phpinfo :
  <img src="https://raw.githubusercontent.com/lightWey/notebook/master/imageHost/2019/04/WX20190403-012735%402x.png" alt="xdebug info in phpinfo web page"></p>
  
  <p>workspace/xdebug.ini :
  <img src="https://raw.githubusercontent.com/lightWey/notebook/master/imageHost/2019/04/WX20190403-013144%402x.png" alt="workspace/xdebug.ini"></p>
  
  <p>php-fpm/xdebug.ini :
  <img src="https://raw.githubusercontent.com/lightWey/notebook/master/imageHost/2019/04/WX20190403-013209%402x.png" alt="php-fpm/xdebug.ini"></p>
  
  <p>docker-composer ps :
  <img src="https://raw.githubusercontent.com/lightWey/notebook/master/imageHost/2019/04/WX20190403-013341%402x.png" alt="docker-composer ps"></p>
  
  <p>Xdebug setting in PhpStorm :
  <img src="https://raw.githubusercontent.com/lightWey/notebook/master/imageHost/2019/04/WX20190403-015112%402x.png" alt="xdebug in PhpStorm setting"></p>
  
  <p>Service setting in PhpStorm :
  <img src="https://raw.githubusercontent.com/lightWey/notebook/master/imageHost/2019/04/WX20190403-015158%402x.png" alt="service setting in PhpStorm"></p>
  
  <p>Remote debug setting in PhpStorm :
  <img src="https://raw.githubusercontent.com/lightWey/notebook/master/imageHost/2019/04/WX20190403-015258%402x.png" alt="remote debug setting in PhpStorm"></p>
  
  <p>PHP Web Page setting in PhpStorm :
  <img src="https://raw.githubusercontent.com/lightWey/notebook/master/imageHost/2019/04/WX20190403-015310%402x.png" alt="php web page setting in PhpStorm"></p>
  
  <p>All of the above are my configuration information.</p>
  
  <p>Let's take a look at the port information</p>
  
  <pre><code>➜  laradock git:(master) lsof -i:9001
  
  
  </code></pre>
  
  <p>Started Listening for PHP Debug connections</p>
  
  <pre><code>➜  laradock git:(master) lsof -i:9001
  COMMAND  PID     USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
  phpstorm 268 lightWay   56u  IPv4 0xa71f266f59200b2d      0t0  TCP *:etlservicemgr (LISTEN)
  </code></pre>
  
  <p>When I type in the URL and press the Enter key, the window will jump to PhpStorm</p>
  
  <p>PhpStorm Like this :
  <img src="https://raw.githubusercontent.com/lightWey/notebook/master/imageHost/2019/04/QQ20190412-173101.png" alt="phpstorm"></p>
  
  <p>When I click 'Step Over(F8)' PhpStorm Like this:
  <img src="https://raw.githubusercontent.com/lightWey/notebook/master/imageHost/2019/04/QQ20190412-173418.png" alt="debug failed"></p>
  
  <p>Debugging can't go on and Chrome is waiting state:
  <img src="https://raw.githubusercontent.com/lightWey/notebook/master/imageHost/2019/04/QQ20190412-173602.png" alt="chrome"></p>
  
  <p>Port information :</p>
  
  <pre><code>➜  laradock git:(master) lsof -i:9001
  COMMAND   PID     USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
  phpstorm  268 lightWay   56u  IPv4 0xa71f266f59200b2d      0t0  TCP *:etlservicemgr (LISTEN)
  phpstorm  268 lightWay   71u  IPv4 0xa71f266f59f45e2d      0t0  TCP localhost:etlservicemgr-&gt;localhost:51955 (CLOSE_WAIT)
  phpstorm  268 lightWay   73u  IPv4 0xa71f266f669227ad      0t0  TCP localhost:etlservicemgr-&gt;localhost:55017 (ESTABLISHED)
  com.docke 648 lightWay   30u  IPv4 0xa71f266f592027ad      0t0  TCP localhost:55017-&gt;localhost:etlservicemgr (ESTABLISHED)
  </code></pre>
  
  <p>If I end my browser access, I got :</p>
  
  <p><img src="https://raw.githubusercontent.com/lightWey/notebook/master/imageHost/2019/04/QQ20190412-173418.png" alt="debug failed"></p>
  
  <p>Port information :</p>
  
  <pre><code>➜  laradock git:(master) lsof -i:9001
  COMMAND   PID     USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
  phpstorm  268 lightWay   56u  IPv4 0xa71f266f59200b2d      0t0  TCP *:etlservicemgr (LISTEN)
  phpstorm  268 lightWay   71u  IPv4 0xa71f266f59f45e2d      0t0  TCP localhost:etlservicemgr-&gt;localhost:51955 (CLOSE_WAIT)
  phpstorm  268 lightWay   73u  IPv4 0xa71f266f669227ad      0t0  TCP localhost:etlservicemgr-&gt;localhost:55017 (ESTABLISHED)
  com.docke 648 lightWay   30u  IPv4 0xa71f266f592027ad      0t0  TCP localhost:55017-&gt;localhost:etlservicemgr (ESTABLISHED)
  </code></pre>
  
  <p>Nothing changes and Xdebug Connection is not broken.</p>
  
  <p>But if I click 'Stop index.php (F12)' my browser request will end.</p>
  
  <p>port like this :</p>
  
  <pre><code>➜  laradock git:(master) lsof -i:9001
  COMMAND  PID     USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
  phpstorm 268 lightWay   17u  IPv4 0xa71f266f68032e2d      0t0  TCP *:etlservicemgr (LISTEN)
  </code></pre>
  
  <p>I feel that PhpStorm has not received a request from the browser or Xdebug.</p>
  
  <p>How do I get the Xdebug work?</p>
  
  <p>Oh, yes, sometimes I can get tips from PhpStorm
  <img src="https://raw.githubusercontent.com/lightWey/notebook/master/imageHost/2019/04/QQ20190412-194821.png" alt="tips"></p>
  
  <p>But I have already configured it in the <code>./laradock/.env</code> file.</p>
  
  <p>Any help would be greatly appreciated... If I need to supply more info, I will gladly do so.</p>