title: php-cgi not found in PhpStorm resulting in 502 bad gateway
body: <p>I'm trying to run a simple php file with PhpStorm (v2017.3). It should output a <code>var_dump</code>, but I constantly encounter a 502 bad gateway error in my browser when running the script. I receive the following error in the PhpStorm:</p>
  
  <blockquote>
    <p>php-cgi not found: Please ensure that configured PHP Interpreter built as CGI program (--enable-fastcgi was specified)</p>
  </blockquote>
  
  <p>When I run <code>php -v</code> in my terminal here is the output:</p>
  
  <pre><code>PHP 7.1.7 (cli) (built: Jul 15 2017 18:08:09) ( NTS )
  Copyright (c) 1997-2017 The PHP Group
  Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
  </code></pre>
  
  <p>Here are the things I've tried so far:</p>
  
  <ul>
  <li>Reinstalling PHP with homebrew with <code>brew uninstall php71</code> and then <code>brew install71</code>.</li>
  <li>Adding the <code>--with-cgi</code> option to my <code>brew install php71</code> command</li>
  <li>Read through the following threads: <a href="https://stackoverflow.com/questions/24239128/phpstorm-problems-with-php-cgi">phpStorm problems with php-cgi</a>, <a href="https://stackoverflow.com/questions/34892046/php-cgi-error-in-phpstorm-when-php-cgi-is-installed">php cgi error in PhpStorm when php-cgi is installed</a></li>
  </ul>