The whole HOWTO [www.hiawatha-webserver.org] is well worth a read.
In addition to the CGI and FastCGI page, see
PHP Config [www.hiawatha-webserver.org].
Here are some of my notes I use when setting up a server (Debian/Ubuntu).
Install PHPParticular packages desired may differ depending on use case.
sudo apt-get install php5-fpm php5-mcrypt php5-cli php5-curl php5-mysql php5-xsl php5-gd
/etc/php5/fpm/php.ini:
cgi.fix_pathinfo = 0
zlib.output_compression = On
zlib.output_compression_level = 6
expose_php = Off
display_errors = Off
allow_url_include = Off
sudo service php5-fpm restart
For once PHP-FPM is installed and configured...
In Ubuntu, I believe PHP-FPM's default socket is /var/run/php5-fpm.sock:
FastCGIserver {
FastCGIid = PHP5
ConnectTo = /var/run/php5-fpm.sock
Extension = php
}
You'll need to uncomment the 'UseFastCGI = PHP5' line in your VirtualHost, which refers to the FastCGIserver above.