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;
root /var/www/;
index index.html index.htm index.php;
access_log /var/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 with your own domain.

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

Continue Reading…

Step1. Install Apache2 using the command:

apt-get install apache2-mpm-worker

Now you cand navigate from  your browser to http://your-ip to check if Apache2 is working (you should see the Apache2 default page with message:  It works).

Step2.  Install PHP5-FPM.

We will make PHP5 work in Apache2 through PHP-FPM and Apache2  mod_fastcgi module.
We need to install apache mod-fastcgi first:

apt-get install libapache2-mod-fastcgi php5

Now install php-fpm:

echo “deb stable all” >> /etc/apt/sources.list
echo “deb-src stable all” >> /etc/apt/sources.list
cat dotdeb.gpg |apt-key add -
apt-get update
apt-get install php5-fpm

Step3. Enable the  Apache2 modules: Continue Reading…

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:

vim /etc/rc.local
/usr/bin/spawn-fcgi -a -p 9000 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/

Step 3: Create virtual host file for your site:

Continue Reading…

Page 1 of 11