IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    某妖发表于 2016-03-07 03:02:41
    love 0
    准备篇

    一、环境说明:

    操作系统:Windows Server 2008 R2

    PHP版本:php 5.4.4
    MySQL版本:MySQL5.5.25

    二、相关软件下载:

    1、PHP下载地址:

    http://windows.php.net/downloads/releases/php-5.4.4-nts-Win32-VC9-x86.zip
    2、MySQL下载地址:
    http://gd.tuwien.ac.at/db/mysql/Downloads/MySQLInstaller/mysql-installer-5.5.25.0.msi
    3、PHP加速软件ZendGuard下载地址:
    http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-Windows.zip
    4、Microsoft .NET Framework 4(独立安装程序)下载地址:
    http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe
    5、Microsoft Visual C++ 2010 可再发行组件包 (x64)下载地址:
    http://download.microsoft.com/download/3/2/2/3224B87F-CFA0-4E70-BDA3-3DE650EFEBA5/vcredist_x64.exe
    6、Microsoft Visual C++ 2008 Redistributable Package (x86)下载地址:

    http://download.microsoft.com/download/7/5/0/7502f4e9-1f90-4895-9259-1bde67b8b9a1/vcredist_x86.exe

    安装篇

    一、安装IIS7.5

    开始-管理工具-服务器管理器

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    系统运维 www.111cn.net 温馨提醒:qihang01原创内容©版权所有,转载请注明出处及原文链接
    选择“角色”点右边的添加角色
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    下一步
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    选择“Web服务器(IIS)”,下一步
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    下一步

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    确保“CGI”被选中,其他的角色服务可根据自己的需要勾选
    这里全部勾选

    下一步

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    安装

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    正在安装

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    关闭,在浏览器里面打开http://localhost/

    出现下面的界面

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    IIS7.5安装完成
    二、安装Microsoft Visual C++ 2010 可再发行组件包 (x64)

    双击打开vcredist_x64.exe

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    选中“我已阅读并接受许可条款”,点安装

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    正在安装

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    完成
    三、安装Microsoft .NET Framework 4(独立安装程序)

    双击dotNetFx40_Full_x86_x64.exe

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    选中“我已阅读并接受许可条款”,点安装

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    正在安装

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    点完成,安装完毕。
    四、安装MySQL

    双击打开mysql-installer-5.5.25.0

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    选择第一项Install MySQL Products(安装MySQL)

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    选中“I accept the license terms”(我接受许可条款),点下一步

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    选中“Skip the check for update (not recommended)”(跳过检查更新),点下一步

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    选中“Custom”(自定义安装),Installation Path(安装路径):D:\Program Files\MySQL

    下一步

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    确保“MySQL Server5.5.25”被选中,点下一步(其他的组件可以选择安装)

    这里全部选中,安装所有组件

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    Execute (执行)

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    选中“我已阅读并接受许可条款”

    点安装

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    完成

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    下一步

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    Execute (执行)

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    下一步

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    系统运维 www.111cn.net 温馨提醒:qihang01原创内容©版权所有,转载请注明出处及原文链接

    下一步

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    Developer Machine(开发服务器)
    Server Machine(普通服务器)
    Dedicated Machine(专用服务器)
    这里选择第二项: Server Machine(普通服务器)

    点下一步

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    勾选“Enable TCP/IP Networking”(开启TCP网络端口)
    Port Number(端口):3306
    勾选“Create Windows Service”(创建Windows系统服务)
    Windows Server Name(Windows服务名):MySQL55
    MySQL Root password:输入密码
    Repeat Password:重复输入密码

    设置好之后,点下一步

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    下一步

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    下一步

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    点Finish(完成)

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    关闭此窗口

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    打开MySQL安装路径
    D:\Program Files\MySQL\MySQL Server 5.5
    复制my-huge.ini为my.ini

    备份my-huge.ini为my-huge.ini_bak

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    开始-所有程序-MySQL-MySQL Server 5.5- MySQL Server 5.5 Command Line Client

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    输入安装时候的MySQL root账号密码,回车

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    登录成功,MySQL安装完成。
    五、安装Microsoft Visual C++ 2008 Redistributable Package (x86)

    双击打开vcredist_x86.exe

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    下一步

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    勾选“我已阅读并接受许可条款”

    点安装

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    完成
    六、安装PHP
    解压php-5.4.4-nts-Win32-VC9-x86.zip文件
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    重命名文件夹为php,把php文件夹拷贝到D盘根目录
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    解压ZendGuardLoader-php-5.3-Windows.zip
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    打开
    D:\soft\ZendGuardLoader-php-5.3-Windows\ZendGuardLoader-php-5.3-Windows\php-5.3.x
    把里面的ZendLoader.dll文件拷贝到D:\php\ext目录中
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    打开D:\php
    复制php.ini-development为php.ini
    用记事本打开php.ini
    做如下修改:
    extension_dir = “D:\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
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    在最后一行添加以下代码
    [ZendGuardLoader]
    zend_loader.enable=1
    zend_loader.disable_licensing=1
    zend_loader.obfuscation_level_support=3
    zend_loader.license_path=
    zend_extension=”D:\php\ext\ZendLoader.dll”
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    系统运维 www.111cn.net 温馨提醒:qihang01原创内容©版权所有,转载请注明出处及原文链接
    最后,保存退出
    七、配置IIS支持PHP
    开始-管理工具- Internet 信息服务(IIS)管理器
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    双击左边“起始页”下面的计算机名称
    找到中间的IIS部分,打开“处理程序映射”
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    点右边的“添加模块映射”
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    请求路径:*.php
    模块:FastCgiModule
    可执行文件(可选):D:\php\php-cgi.exe
    名称:FastCGI
    最后,确定
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    点“是”
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    双击左边“起始页”下面的计算机名称
    找到中间的IIS部分,打开“FastCGI设置”
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    右键选中:D:\php\php-cgi.exe然后选择编辑
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    监视对文件所做的更改:D:\php\php.ini
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    环境变量,点旁边的”…”
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    点“添加”
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    Name:PHP_FCGI_MAX_REQUESTS
    Value:10000
    确定
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    确定
    测试篇
    打开:
    C:\inetpub\wwwroot
    新建一个index.php文件
    内容如下:
    <?php
    phpinfo();
    ?>
    最后,保存退出
    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境
    在浏览器里面打开http://localhost/
    出现下面的界面,说明配置成功!

    Windows2008 R2服务器配置IIS7.5+PHP5(FastCGI)+MySQL5环境

    至此,Windows Server 2008 R2 IIS7.5+PHP5(FastCGI)+MySQL5环境搭建教程完成



沪ICP备19023445号-2号
友情链接