在windows 2003 server中配置PHP FastCGI模式,步骤如下:
1、下载软件
http://www.microsoft.com/web/platform/phponwindows.aspx 类型:php on windows进行安装 ,安装好后文件在:C:\WINDOWS\system32\inetsrv 目录下 fcgi打头的文件。这时IIS 的 “Web 服务扩展”里会多出一个FastCGI Handler
2、到 php.net 下载 php-5.32-Win32-VC9-x86.zip 文件,并将其复制到:D:\PHP\php5目录(你可以根据自己的意愿解压到别的目录。),并给 IIS 启动帐户组或用户赋予读取和运行权限。
3、注册 PHP 到 FastCGI
打开 C:\WINDOWS\system32\inetsrv\fcgiext.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%\system32\inetsrv directory.
在 [Types] (约第162行)下添加以下配置:
[Types]
php=PHP
[PHP]
ExePath=D:\PHP\PHP5\php-cgi.exe
这里要用:“\”不能用“/”,“php”表示扩展名,“PHP”是配置节名称,以“[PHP]”定义。
4、打开IIS管理器,网站上点右键-属性-主目录-配置-添加,配置 fcgiext.dll GET,POST,TRACE,DEBUG,HEAD
5、配置PHP.INI
6、先运行D:\PHP\PHP5\php-cgi.exe如果能进入命令窗口并只有光标,说明FastCGI能正常调用php-cgi,否则会提示错误,这点对使用微软的fastcgi模式很重要。
更新时间:2010-5-24