Debian5 安装Nginx+php(spawn-fcgi) + Mysql

安装mysql

apt-get install mysql-server

安装php

apt-get install php5-common php5-cgi php5-mysql php5-curl php5-gd php5-imagick php5-mcrypt  php5-sqlite php-apc

安装Nginx

apt-get install nginx

安装spawn-fcgi

$wget http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.gz
$tar -xvf spawn-fcgi-1.6.3.tar.gz
$cd spawn-fcgi-1.6.3
$./configure –prefix=/usr
$make

$sudo make install

启动php5-cgi
$spawn-fcgi -a 127.0.0.1 -p 9000  -u www-data -g www-data -f /usr/bin/php5-cgi

配置Nginx

修改/etc/nginx/sites-available/default
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ .php$ {
fastcgi_pass   127.0.0.1:9000;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME  /var/www/nginx-default$fastcgi_script_name;
include        fastcgi_params;
}

重启nginx
/etc/init.d/nginx restart

原创文章,转载请注明: 转载自贝壳博客

本文链接地址: Debian5 安装Nginx+php(spawn-fcgi) + Mysql

1 评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据