Debian7官方源添加了php-fpm软件包,现可通过apt-get快速安装部署LNMP环境了。
安装Mysql:
apt-get install -y mysql-server mysql-client
安装PHP:
apt-get install php5-cli php5-fpm php5-mysql php5-curl
安装Nginx:
apt-get install nginx-full
Nginx主配置文件为:
/etc/nginx/nginx.conf
调用虚拟主机配置文件目录:
/etc/nginx/sites-enabled/
修改默认虚拟主机配置文件支持PHP解析:
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}