title: debugging laravel artisan from PHPStorm with homestead
body: <p>I setup Laravel Homestead. I then configured both homestead <em>xdebug.ini</em> and <em>PHPStorm</em> to make the debugging work.</p>
  
  <p><strong>Here is my xdebug.ini inside homestead</strong></p>
  
  <pre><code>zend_extension=xdebug.so
  xdebug.remote_autostart = on
  xdebug.remote_enable = on
  xdebug.remote_connect_back = on
  xdebug.remote_port = 9000
  xdebug.idekey = "vagrant"
  </code></pre>
  
  <p><strong>To start a debugging session the steps I follow are</strong></p>
  
  <ol>
  <li>In PHPStorm --> Start Listening for connections</li>
  <li>In PHPStorm set a breakpoint</li>
  <li>In my browser --> Use XDebug Chrome Helper OR add to my URL ?XDEBUG_SESSION_START=</li>
  <li>Load the page</li>
  </ol>
  
  <p>This works perfectly. My problem is when I'm inside homestead command line and I run a <code>php artisan</code> command then I can't get it to hit my breakpoints.</p>
  
  <p><strong>What I've tried</strong></p>
  
  <ol>
  <li><p><code>XDEBUG_CONFIG="idekey=PHPSTORM" PHP_IDE_CONFIG="serverName=server_name" php -dxdebug.remote_host="127.0.0.1" artisan mycommand</code></p></li>
  <li><p><code>php -d xdebug.profiler_enable=On artisan mycommand</code></p></li>
  <li><p>I also tried to set <code>xdebug.remote_autostart=On</code> then <code>sudo service php5-fpm restart</code> but still my breakpoints never get hit in PHPStorm</p></li>
  </ol>