I'm trying to run a simple php file with PhpStorm (v2017.3). It should output a var_dump
, but I constantly encounter a 502 bad gateway error in my browser when running the script. I receive the following error in the PhpStorm:
php-cgi not found: Please ensure that configured PHP Interpreter built as CGI program (--enable-fastcgi was specified)
When I run php -v
in my terminal here is the output:
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
Here are the things I've tried so far:
- Reinstalling PHP with homebrew with
brew uninstall php71
and thenbrew install71
. - Adding the
--with-cgi
option to mybrew install php71
command - Read through the following threads: phpStorm problems with php-cgi, php cgi error in PhpStorm when php-cgi is installed
/usr/local/bin/php
? Prefs, Languages & Frameworks, PHP -> CLI interpreter. Click on the '...' and point to the php in /usr/local/bin/usr/bin/php