This article is about setting up Nginx + PHP-FastCGI on Debian 6.0.6 Squeeze

Step1. Install nginx and php5-cgi :

apt-get install nginx php5-cgi

Step2. Replace Nginx default virtualhosts config with the following content:

server {
listen [::]:80;
server_name debian-tutorials.com;
root /var/www/debian-tutorials.com;
index index.html index.htm index.php;
access_log /var/log/debian-tutorials.com.access.log;

location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/tmp/php.socket;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

NOTE: Replace debian-tutorials.com with your own domain.

Step3. Create a  Debian init script to control the php-cgi daemon.

Continue Reading…

Page 1 of 11