Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

php

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)
like image 701
Ali Gajani Avatar asked May 15 '14 00:05

Ali Gajani


People also ask

How do I enable FastCGI?

Add the CGI role service by going to Server Manager > Roles > Add Role Services. Under Application Development, select the CGI check box. This enables both the CGI and FastCGI services (selecting CGI enables both CGI and FastCGI).

How to enable FastCGI on IIS?

Enable FastCGI Support in IISGo to Server Manager > Roles > Add Role Services. On the Select Role Services page, select the CGI check box. This enables both the CGI and FastCGI services.

What is PHP-FPM command?

PHP-FPM is a service which executes PHP code on behalf of a web server. As NGINX is unable to natively execute PHP code, it can be onfigured to pass all . php files over to PHP-FPM.


1 Answers

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..

like image 141
GotchaRob Avatar answered Sep 20 '22 02:09

GotchaRob