- 本教程是在我配置好服务器后,整理出的,所以有些图是借用别人的.
- 本教程是小白根据别人博客研究后根据实际遇到的问题所写,一切都是自己摸索加百度
- 本教程的整个环境为
windows server2016 + iis10 + php5.6 + mysql5.7
- 我买的是阿里云的ECS服务器,所以系统直接就是 windows server2016.
- 有些新人可能不知道iis是什么,这里简单说下,他和apache和tomcat是一样的服务器软件
一、打开 开始菜单
—— 服务器管理器
—— 添加角色和功能


二、开始之前下一步
,安装类型下一步


三、服务器选择
从服务器池中选择服务器
——下一步

四、选择 Web服务器(IIS)
,为了安装 PHP,所以我们还要选择安装应用程序开发
——CGI
——下一步

五、为了保障兼容性,选择性安装 .Net 3.5 兼容旧程序。(重要:在最后一步安装的时候,有些人可能.net3.5会安装失败)

.net3.5安装失败看这里解决,成功的请直接看第六步

原因分析
找不到安装源文件。
解决办法
可以通过如下 PowerShell
脚本进行安装:
从开始菜单中找到 PowerShell
,右击选择 以管理员身份运行。

输入如下脚本后回车执行:
- Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' -Name UseWUServer -Value 0
- Restart-Service -Name wuauserv
- Install-WindowsFeature Net-Framework-Core
- Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' -Name UseWUServer -Value 1
- Restart-Service -Name wuauserv
到这里.net3.5就安装完事了,我们只要确保CGI安装ok就行了.
六、单击 安装
——关闭


七、然后我们就可以在开始菜单中找到 IIS 了

八、打开及验证是否已经安装好

九、在 Edge 中输入:http://localhost 显示如下即成功

借鉴与 :
Windows Server 2016 配置指南 之 IIS10 环境安装篇
Windows Server 2012 R2 或 2016 无法安装 .NET Framework 3.5.1
网友评论