IIS8.5+PHP(FastCGI)安装配置

皇甫树
2023-12-01


准备篇

一、相关软件下载:

1、PHP下载地址:

http://windows.php.net/downloads/releases/php-5.5.8-nts-Win32-VC11-x86.zip

2、MySQL下载地址:

http://cdn.mysql.com/Downloads/MySQLInstaller/mysql-installer-community-5.6.15.0.msi

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


安装篇

一、安装IIS8.5

二、安装PHP

1、安装Visual C++ Redistributable for Visual Studio 2012 Update 4(x86)

2. 解压php-xxx-nts-x86 / x64-VC11.zip文件

3.打开C:\php

复制php.ini-production为php.ini

用记事本打开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


4、配置IIS支持PHP (Fast CGI php)

   (1) IIS-计算机名称

  打开“处理程序映射”

 “添加模块映射”

请求路径:*.php

模块:FastCgiModule

可执行文件(可选):C:\php\php-cgi.exe

名称:FastCGI

最后,确定

(2)打开“FastCGI设置”,可选,根据实际需要配置 或 使用默认

测试 http://localhost:xxx/phpinfo







 类似资料: