Ali Gajani
Ali Gajani

Reputation: 15089

How do I enable fastcgi on my Mavericks using PHP 5.4.24?

I am trying to use PHPStorm 7's built-in web server feature and I have specified the interpreter as PHP 5.4.24 but it keeps telling me this below.

How do I enable FastCGI on a Mavericks machine. I checked that it isn't configured/enabled by doing php -i on my Terminal. Any help would be appreciated. I want to test apps in the browser.

php-cgi not found
Please ensure that configured PHP Interpreter built as CGI program (--enable-fastcgi was specified)

Upvotes: 5

Views: 10203

Answers (1)

GotchaRob
GotchaRob

Reputation: 458

If it's not already done install Homebrew :

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Now, that we've Homebrew, tap php repositories by entering this on your terminal :

brew tap josegonzalez/php
brew tap homebrew/dupes

Check what options are available for PHP 5.4 :

brew options php54

Now install/build PHP 5.4 with some option (in your case PHP-FPM with CGI) :

brew install php54 --with-fpm --with-debug --with-cgi --with-libmysql --with-homebrew-curl
brew install fastcgi

Note : If you're not going to use Apache add --without-apache, if you need others things, just check the options and add what you need

Now, check if PHP-FPM is enable by typing this in your terminal :

php-fpm -v

If you get this :

PHP 5.4.24 (fpm-fcgi) Copyright (c)

1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013

Zend Technologies

You just installed PHP with FCGI like a boss..

Upvotes: 8

Related Questions