title: How do I setup my host machine's PHP interpreter to point to the container's PHP interpreter
body: <p>I would like to configure PHPStorm so that I can run Artisan commands directly from my IDE's terminal. For example <code>php artisan key:generate</code>. However, when I do, I receive the error <code>'php' is not recognized as an internal or external command</code>.</p>
  
  <p>Background:</p>
  
  <ul>
  <li>running Windows 10 as host machine</li>
  <li>using Docker to run my webserver (Nginx) and PHP interpreter (7.2-fpm). </li>
  <li>I followed this tutorial. 
  <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-laravel-nginx-and-mysql-with-docker-compose" rel="nofollow noreferrer">https://www.digitalocean.com/community/tutorials/how-to-set-up-laravel-nginx-and-mysql-with-docker-compose</a>. </li>
  </ul>
  
  <p>One thing the tutorial didn't cover was how to set up my remote PHP CLI interpreter. For that, I followed <a href="https://www.jetbrains.com/help/phpstorm/configuring-remote-interpreters.html" rel="nofollow noreferrer">https://www.jetbrains.com/help/phpstorm/configuring-remote-interpreters.html</a> and can make a successful connection as it picks up the correct PHP version <em>7.2.21</em> as seen in the screenshot. </p>
  
  <p><a href="https://i.stack.imgur.com/v5suv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v5suv.jpg" alt="Remote PHP CLI Interpreter"></a></p>
  
  <p>After this, I restarted my Windows 10 host machine, fired up the container, opened my IDE and tried to run <code>php -v</code> from the terminal but hit the error again. </p>
  
  <p><a href="https://i.stack.imgur.com/uaeCB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uaeCB.jpg" alt="PHP interpreter not found"></a></p>
  
  <p>I know it has something to do with my <em>PATH</em> environment variable being set incorrectly, or not at all but I am not sure how to point it to the container's PHP interpreter. Any help would be greatly appreciated. </p>
  
  <p><strong>EDIT</strong></p>
  
  <p>For what it is worth, I know that I can <code>exec</code> into the container and run PHP commands from there, but thought I might be able to do it directly from my host machine by pointing to the container's interpreter. </p>
  
  <p><a href="https://i.stack.imgur.com/SV6gL.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SV6gL.jpg" alt="&lt;code&gt;exec&lt;/code&gt; + PHP commands"></a></p>