Setting up Nginx / PHP-FPM on Ubuntu 10.04

Here is how I got this running on a VirtualBox guest quickly and easily.

First I update sources:

sudo apt-get update
sudo apt-get install python-software-properties
sudo apt-get upgrade
sudo add-apt-repository ppa:nginx/stable
sudo add-apt-repository ppa:nginx/php5

Then install the software:

sudo apt-get install nginx
sudo apt-get install php5-fpm

Next step is to enable fastcgi in /etc/nginx/sites-available/default

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}

Lastly, restart the Nginx service:

sudo /etc/init.d/nginx restart

Then I create a phpinfo.php file in /usr/share/nginx/www (or wherever your web root directory is) and browsed it.

Nginx PHP-FPM

UPDATE: the best guide I've found to date http://michael.lustfield.net/content/dummies-guide-nginx