I've been wanting to try out Nginx with PHP-FPM. I installed Nginx via Macports. I read that PHP 5.3.3 includes PHP-FPM, however, the PHP 5.3.3 configuration on Macports does not enable it.

Can anyone explain or refer me to a tutorial on how to install PHP 5.3.3 with PHP-FPM for Nginx on OS X? I'd want to place it in /opt where Nginx is to keep it away from the PHP I'm using with Apache in /usr/local.

4 Answers
4

I was able to take @Struder's answer above and mostly make it work, but like @Seth I was getting the "cannot stat sapi/cgi/php-cgi" error.

I ended up making some additional tweaks to the Portfile: Adding enable-fpm only when the fastcgi variant is used, getting rid of the "cannot stat" error, and copying the default php-fpm config file into place. The config file still needs to be user-customized, but this portfile will get you up and running with php5.3.3.