0

I am having a problem with PhpStorm (10.0.3) on OS X El Capitan‎ throwing a php-cgi not found error on PHP 7 cgi/fastcgi. I tried the solutions offered in "How do I install php-cgi? I tried MacPort, Package and everything else but none works", but these did not work. I've consulted this: http://blog.jetbrains.com/phpstorm/2013/09/built-in-webserver-in-phpstorm/ but it is not helpful. I also tried a cgi install of PHP 5.6 but this has the same problem as PHP 7.

I have installed PHP70-cgi using macport and verified the install is cgi-fcgi:

$ php-cgi70 -v
PHP 7.0.2 (cgi-fcgi) (built: Jan 19 2016 16:48:28)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies

When I try to use php-cgi70 from within PhpStorm it appears to incorrectly default to CLI:

PHP version: 7.0.2
PHP CLI: /opt/local/bin/php-cgi70 PHP CGI: Not Installed (php-cgi sapi is necessary to use built-in web server) 
Loaded Configuration File: /opt/local/etc/php70/php.ini

I've also tried the macport install of php-fpm70, but this is not recognized by PhpStorm.

Does anyone have any ideas on resolving this? Thanks in advance.

Community
  • 1
  • 1
Nick
  • 21
  • 1
  • 6

3 Answers3

0

PhpStorm can't find the PHP CGI binary. Do this on your shell to fix:

cd /opt/local/bin
sudo ln -s php-cgi70 php-cgi
yowmamasita
  • 4,810
  • 3
  • 17
  • 17
0

sudo apt-get install php-xdebug

ScottW
  • 1
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/16075043) – georoot May 09 '17 at 18:09
  • @georoot There is no link in this answer. Please don't just add random review comments. – Baum mit Augen May 09 '17 at 23:47
0

Another way for macOS is to install PHP all together with simple cURL:

curl -s https://php-osx.liip.ch/install.sh | bash -s 7.2

OR install Homebrew and then PHP with CGI (better practice):

  1. /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. brew install php72 --with-cgi --with-debug --with-libmysql

And link it in PhpStorm:

Image: PhpStorm: PHP Config


For more info about Homebrew, visit documentation here.