apt-get install nginx
apt-get install php-cgi php-mysql php-gd
apt-get install mysql-server
apt-get install rcconf
apt-get install lighttpd
update-rc.d -f lighttpd remove
# 也可以用rcconf
去 除
lighttpd
vi /etc/nginx/sites-available/default
#
index的一行修改为:
index index.php index.html index.htm;
#
去掉下面部分的注释:
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 /etc/nginx/fastcgi_params;
}
vi /etc/rc.local
#
加入 spawn-fcgi
-f /usr/bin/php-cgi -a 127.0.0.1 -p 9000 -C 10 -u www-data
-g www-data
shutdown -r now
# 重启后即执行
rc.local 中脚本,启动 Fast CGI 进程
本文介绍如何使用Ubuntu系统的apt-get安装Nginx、PHP及相关模块,并配置Nginx与PHP-FPM以实现PHP页面的快速处理。此外,还介绍了如何安装MySQL服务器以及如何配置FastCGI进程。
2589

被折叠的 条评论
为什么被折叠?



