The following tutorial is done with Debian Squeeze version 6.0.2.
In this tutorial, I will show you the shortest and easiest way to set up nginx with PHP5, MySQL and phpmyadmin running through FastCGI:
Step 1: Installation:
apt-get install nginx mysql-server mysql-client php5 php5-cgi php5-mysql phpmyadmin
NOTE: After you have installed all above you will need to edit the php.ini file:
Open php.ini file end remove the ; in front of the line cgi.fix_pathinfo=1
Step 2: Make PHP FastCGI daemon listening on port 9000 on localhost and start at boot.
Edit the /etc/rc.local file and put the following content:
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/fastcgi-php.pid
Step 3: Create virtual host file for your site: