序:此前是一直部署的都是 liunx 的 CentOS 操作系统的,突然,接到一个是Windows的系统的服务器,把我整不会了,嘎,嘎...,差点就芭比Q了,看了大量文章,好吧,自己动手;
1、下载PHP,下载地址:windows.php.net - /downloads/releases/

2、安装包拷贝到到新建的php文件夹下并解压,复制一份php.ini-development 文件命名为php.ini

3、打开服务器管理,可以看到我已经下载了IIS,不过还可以在添加角色和功能 下安装其他需要的功能


一步步走,选择需要的功能;进入站点程序配置

选着配置,添加php模块映射,在默认文档里添加 index.php 放在第一位;


4、请求路径和模块都是像以下一样的,执行文件按你安装的目录来,名称自定义

然后在的访问的public下有一个web.configd的文件,这个是设置伪静态的,内容为:
- <?xml version="1.0" encoding="UTF-8"?>
- <configuration>
- <system.webServer>
- <rewrite>
- <rules>
- <rule name="OrgPage" stopProcessing="true">
- <match url="^(.*)$" />
- <conditions logicalGrouping="MatchAll">
- <add input="{HTTP_HOST}" pattern="^(.*)$" />
- <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
- <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
- </conditions>
- <action type="Rewrite" url="index.php/{R:1}" />
- </rule>
- </rules>
- </rewrite>
- <defaultDocument>
- <files>
- <add value="index.php" />
- </files>
- </defaultDocument>
- </system.webServer>
- </configuration>
5、点击网站下的网站目录,右侧有个浏览网站的 浏览 *.80(http) ,可以访问你的站点;
右侧这里可以配置修改你的网站目录、名称等等;
报错:vcruntime140.dll丢失的解决方法;
下载安装(下载后直接运行就可以):Download Visual C++ Redistributable for Visual Studio 2015 from Official Microsoft Download Center

6、证书绑定看下面的一篇参考文章;
参考文章:
windows server 2019开启iis服务器+tp5.1的配置
证书配置参考:
https://jingyan.baidu.com/article/154b46316f77fe28ca8f4136.html
到此这篇关于windows server 2012 r2 服务器部署tp6 项目的文章就介绍到这了,更多相关windows server 2012 r2 部署内容请搜索w3xue以前的文章或继续浏览下面的相关文章希望大家以后多多支持w3xue!