Firebird News

Wednesday, August 20, 2008

Nginix + php howto

#1. install the needed packages
$apt-get install php5-cli php5-cgi build-essential libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev
#2. install nginix from source

$mkdir -p /opt/build/nginx
$cd /opt/build/nginx
$wget --continue
$tar -zxvf nginx-0.6.32.tar.gz
$cd nginx-0.6.32
$./configure --prefix=/opt/nginx --with-http_flv_module
$sudo make install
#3.install fast cgi support for php

tar -zxvf lighttpd-1.4.19.tar.gz
cd lighttpd-1.4.19
./configure ; make

cp src/spawn-fcgi /usr/bin/spawn-fcgi

sudo vi /usr/bin/php-fastcgi

/usr/bin/spawn-fcgi -a -p 9000 -u www-data -f /usr/bin/php5-cgi

sudo chmod +x /usr/bin/php-fastcgi

update-rc.d init-fastcgi defaults

/etc/init.d/init-fastcgi start

in nginx conf uncomment add these lines

location ~ \.php$ {
root /var/www;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/$fastcgi_script_name;
include fastcgi_params;

and you should start the nginix server


load the http://localhost

You can add an init script for it this way
Post a Comment