wnmp windows 2012 r2+php7.0+nginx1.14安装

1安装包
Nginx 下载 http://nginx.org/en/download.html
PHP http://php.net/downloads.php 选择对应操作系统非线程安全(NTS)
mysql安装msi安装
https://dev.mysql.com/downloads/file/?id=471661
mysql压缩包 https://dev.mysql.com/downloads/mysql/5.7.html#downloads
2安装
解压后可以把PHP和Nginx文件放在一个文件夹下面 比如 c:www
2.1nginx 运行
运行Nginx目录下面的 nginx.exe 打开localhost
看到Nginx欢迎界面表示安装成功
3环境配置
3.1Nginx配置支持PHPfastcgi
用编辑器打开Nginx目录下面的 nginx.conf
找到
location / {,
root html;
index index.html index.htm;
}
改为
location / {,
root c:www;
index.php index index.html index.htm;
}
找到
#location ~ .php$ {
#root html;
#fastcgi_pass 127.0.0.1:9000;
#fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
#include fastcgi_params;
#}
去掉前面的#注释 改为
location ~ .php$ {
root c:www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
3.2PHP配置
打开PHP目录
php.ini-development复制一份改名为php.ini
将;extension_dir = "ext"改为extension_dir = “c:wwwext”。(以自己的实际目录为准)
将;cgi.fix_pathinfo=1去掉前面“;”:cgi.fix_pathinfo=1(使nginx能够支持php)
将;date.timezone = 改为;date.timezone = Asia/ChongQing(时间配置)
4测试
在c:www下面新建 index.php
写入<?php phpinfo();
4.1打开nginx
运行nginx 下面的nginx.exe (如果之前已经启动 先关闭后台进程中的 nginx.exe)
4.2打开PHP
cd 到PHP目录下
php-cgi.exe -b 127.0.0.1:9000 -c php.ini
在浏览器输入localhost 显示PHP信息表示成功

 

原文地址:https://www.cnblogs.com/qsAnunnaki/p/10354745.html