加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

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

发布时间:2020-12-14 02:33:45 所属栏目:Windows 来源:网络整理
导读: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.

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信息表示成功

?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读