1.下载的软件:
http://www.microsoft.com/web/platform/phponwindows.aspx php on windows
安装 ,安装好后文件在 : C:WINDOWSsystem32inetsrv 目录下 fcgi打头的文件。
IIS 的 “Web 服务扩展”里多了 FastCGI Handler
2. 到 php.net 下载 php-5.32-Win32-VC9-x86.zip 文件,并将其复制到:D:PHPphp5目录(你可以根据自己的意愿解压到别的目录。),并给 IIS 启动帐户组或用户赋予读取和运行权限.
3. 注册 PHP 到 FastCGI
打开 C:WINDOWSsystem32inetsrvfcgiext.ini 文件。
; This is the configuration file for the FastCGI handler for IIS 6.0.
; The FastCGI handler will look for this file in the same directory as
; fcgiext.dll. By default, the FastCGI installer will place this file into
; the %windir%system32inetsrv directory.
打开 C:WINDOWSsystem32inetsrvfcgiext.ini 文件。
; This is the configuration file for the FastCGI handler for IIS 6.0.
; The FastCGI handler will look for this file in the same directory as
; fcgiext.dll. By default, the FastCGI installer will place this file into
; the %windir%system32inetsrv directory.
在 [Types] (约第162行)下添加以下配置:
[Types]
[Types]
php=PHP
[PHP]
ExePath=D:PHPPHP5php-cgi.exe
这里要用:“”不能用“/”,“php”表示扩展名,“PHP”是配置节名称,以“[PHP]”定义。
4.打开IIS管理器,网站上点右键-属性-主目录-配置-添加,配置 fcgiext.dll
GET,POST,TRACE,DEBUG,HEAD
5. 配置PHP.INI
6.先运行D:PHPPHP5php-cgi.exe如果能进入命令窗口并只有光标,说明FastCGI能正常调用php-cgi,否则会提示错误,这点对使用微软的fastcgi模式很重要。