在centos7.0下安装nginx需要安装 prce和zlib包去官网下载相应的包
然后解压相应的包进行编译 解压nginx源码包进入到解压文件
./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module --with-pcre=/usr/local/pcre-8.0.0 --with-zlib=/usr/local/zlib-1.2.11
vi /usr/local/nginx/conf/nginx.conf
# 删除如下部分的注释,保存退出,
location ~ .php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;
include fastcgi_params;
}