douan8473 2016-01-20 05:14 采纳率: 100%
浏览 715

安装php-cgi时,PhpStorm中的php cgi错误

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.

  • 写回答

3条回答 默认 最新

  • douqipi9704 2016-11-11 17:47
    关注

    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
    
    评论

报告相同问题?