windows server 2012R2 安装mysql
上车准备
一、准备工具
服务器操作系统:Windows Server 2012
PHP版本:5.6.9(根据自己需要)
MySQL版本:MySQL8.0.17
二、相关软件下载
1、PHP下载
https://windows.php.net/downloads/releases/archives/2、MySQL下载
https://dev.mysql.com/downloads/installer/
3、Visual C++ Redistributable for Visual Studio 2012 Update 4(x64)下载地址(安装PHP需要此插件)
http://download.microsoft.com/download/9/C/D/9CD480DC-0301-41B0-AAAB-FE9AC1F60237/VSU4/vcredist_x64.exe
4、Visual C++ Redistributable for Visual Studio 2012 Update 4(x86)下载地址(安装PHP需要此插件)
http://download.microsoft.com/download/9/C/D/9CD480DC-0301-41B0-AAAB-FE9AC1F60237/VSU4/vcredist_x86.exe
5、Microsoft Visual C++ 2010 可再发行组件包 (x86)下载地址(安装MySQL需要此插件)
http://download.microsoft.com/download/5/B/C/5BC5DBB3-652D-4DCE-B14A-475AB85EEF6E/vcredist_x86.exe
6、Microsoft URL 重写模块 2.0下载地址(IIS8.5伪静态需要此插件)
http://download.microsoft.com/download/4/E/7/4E7ECE9A-DF55-4F90-A354-B497072BDE0A/rewrite_x64_zh-CN.msi
上车上车
一、安装IIS
打开服务器管理器→添加角色和功能
服务器角色:勾选Web服务器(IIS)弹出对话框选择添加功能下一步
角色服务:Web服务器全部勾选上(特别是CGI必须勾选上)下一步
最后确认安装,关闭软件。
验证:在浏览器输入127.0.0.1,看到方格界面就算成功了。
二、安装PHP
1、安装Visual C++ Redistributable for Visual Studio 2012 Update 4(x86)和Visual C++ Redistributable for Visual Studio 2012 Update 4(x64)
2、解压下载好的PHP压缩包,打开找到php.ini-production复制重命名为php.ini,用记事本打开做如下修改:
extension_dir = "C:\php\ext" #设置php模块路径
date.timezone = PRC #设置时区为中国时区
register_globals = On #开启GET数据调用
short_open_tag = On #php支持短标签
cgi.force_redirect = 0 #开启以CGI方式运行php
fastcgi.impersonate = 1;
cgi.rfc2616_headers = 1
以下php扩展模块,根据需要选择开启,取消前面的分号为开始相应扩展模块
extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_exif.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_sockets.dll
extension=php_xmlrpc.dll
extension=php_pdo_mysql.dll
最后保存退出。
3、配置IIS支持PHP
打开:控制面板-系统和安全-管理工具-Internet Information Services(IIS)管理器→
双击左边“起始页”下面的计算机名称→找到中间的IIS部分,打开“处理程序映射”
点击右边的“添加模块映射”→请求路径:*.php→模块:FastCgiModule→可执行文件(可选):文件所在盘\php-cgi.exe→名称
FastCGI设置→选中右击编辑→监视对文件所做的更改:所在盘\php.ini→环境变量→添加Name:PHP_FCGI_MAX_REQUESTS和Value:1000
默认文档→添加一个index.php文件
4、测试PHP程序是否正常运行
打开:
C:\inetpub\wwwroot
新建一个index.php文件
内容如下:
<?php
phpinfo();
?>
在浏览器里面打开http://127.0.0.1/
出现关于php的界面,说php程序可以正常运行。
三、安装MySQL
打开安装包(有免安装版我用的安装版)
直接下一步直到输入密码创建一个密码继续下一步
四、配置IIS支持伪静态
安装重写模块
在:控制面板\系统和安全\管理工具\Internet Information Services (IIS)管理器中可以看到”URL重写“
在:网站根目录下新建文件web.config,添加伪静态规则代码即可实现网站静态化
windows Server2012r2安装mysql8 windows server 2012安装mysql
windows server2012安装mysql8.0报错 windows server 2012 r2 安装mysql
windows2012server r2 安装mysql windows server 2012 r2 mysql
windows server 2012安装mysql windows2012安装mysql5.7
windows server 2012 r2离线安装mysql windows2012安装mysql5.7
windows server2012 r2安装mysql windows2012安装sqlserver2005
windows server 2012 mysql Windows server 2012 mysql 优化
winds server2012 安装mysql windows2012安装sqlserver2005
windows server2012 安装MariaDB server2012安装mysql5.7