IIS 6 下配置以 FastCGI 跑 PHP
2013-04-26 21:52
363 查看
环境:
操作系统:Windows 2003 Server SP2
PHP 版本:php-5.2.6-Win32
1.下载 FastCGI For IIS6
http://www.iis.net/download/fastcgi
下载之后,双击运行进行安装。
安装后在 C:\WINDOWS\system32\inetsrv 目录下产生了五个文件。如下图:
![](http://images.cnblogs.com/cnblogs_com/shanyou/Windows-Live-Writer/a0034df81d51_F83D/image_thumb.png)
fcgiext.dll – fastcgi处理程序
fcgiext.ini – 配置文件
fcgiconfig.js – FastCGI的控制脚本
同时在 IIS 的 “Web 服务扩展”里多了 FastCGI Handler。
![](http://images.cnblogs.com/cnblogs_com/shanyou/Windows-Live-Writer/a0034df81d51_F83D/iis6fcgi_2_thumb.jpg)
2.下载 PHP5.2.14 Windows 版
http://www.php.net/downloads.php
下载 .zip 格式的版本,下载后解压至 c:\PHP 目录,并给 IIS 启动帐户组或用户赋予读取和运行权限。如下图:
![](http://images.cnblogs.com/cnblogs_com/shanyou/Windows-Live-Writer/a0034df81d51_F83D/iis6fcgi_3_thumb.jpg)
你可以根据自己的意愿解压到别的目录。
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.
我个人的理解是,只要“Web 服务扩展”里的 FastCGI Handler 为允许时,在加载 fcgiext.dll 时,会读取 fcgiext.ini 配置文件的内容,根据里面的配置为每个网站提供映射。
在 [Types] 下添加以下配置:
[Types]
php=PHP
[PHP]
ExePath=C:\PHP\php-5.2.14-Win32\php-cgi.exe
“php”表示扩展名,“PHP”是配置节名称,以“[PHP]”定义。
4. 配置 php.ini
将 C:\PHP\php-5.2.14-Win32\php.ini-recommended 复制一个,然后重命名为 D:\PHP\php.ini
打开 C:\PHP\php-5.2.14-Win32\php.ini,修改:
extension_dir = "C:\PHP\php-5.2.14-Win32\ext"
fastcgi.impersonate = 1
其它的根据实际需要对 php.ini 进行设置修改,这里只针对能跑 php,修改完记得重启 IIS。
5. 配置网站
右键网站 => 属性 => 主目录 => 配置 => 添加,如下图配置:
![](http://images.cnblogs.com/cnblogs_com/shanyou/Windows-Live-Writer/a0034df81d51_F83D/iis6fcgi_4_thumb.jpg)
可执行文件路径:C:\WINDOWS\system32\inetsrv\fcgiext.dll
6. 写个 php 测试下吧
<?php
phpinfo();
?>
看到类似以下效果说明你的服务器可以跑 php 了。
![](http://images.cnblogs.com/cnblogs_com/shanyou/Windows-Live-Writer/a0034df81d51_F83D/image_thumb_2.png)
打开后如果出现提示:No input file specified. 估计是没配置 fastcgi.impersonate。
参考 http://hi.baidu.com/imdao/blog/item/16583512f11cb654f819b858.html
Configure the FastCGI Extension for IIS 6.0
操作系统:Windows 2003 Server SP2
PHP 版本:php-5.2.6-Win32
1.下载 FastCGI For IIS6
http://www.iis.net/download/fastcgi
下载之后,双击运行进行安装。
安装后在 C:\WINDOWS\system32\inetsrv 目录下产生了五个文件。如下图:
![](http://images.cnblogs.com/cnblogs_com/shanyou/Windows-Live-Writer/a0034df81d51_F83D/image_thumb.png)
fcgiext.dll – fastcgi处理程序
fcgiext.ini – 配置文件
fcgiconfig.js – FastCGI的控制脚本
同时在 IIS 的 “Web 服务扩展”里多了 FastCGI Handler。
![](http://images.cnblogs.com/cnblogs_com/shanyou/Windows-Live-Writer/a0034df81d51_F83D/iis6fcgi_2_thumb.jpg)
2.下载 PHP5.2.14 Windows 版
http://www.php.net/downloads.php
下载 .zip 格式的版本,下载后解压至 c:\PHP 目录,并给 IIS 启动帐户组或用户赋予读取和运行权限。如下图:
![](http://images.cnblogs.com/cnblogs_com/shanyou/Windows-Live-Writer/a0034df81d51_F83D/iis6fcgi_3_thumb.jpg)
你可以根据自己的意愿解压到别的目录。
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.
我个人的理解是,只要“Web 服务扩展”里的 FastCGI Handler 为允许时,在加载 fcgiext.dll 时,会读取 fcgiext.ini 配置文件的内容,根据里面的配置为每个网站提供映射。
在 [Types] 下添加以下配置:
[Types]
php=PHP
[PHP]
ExePath=C:\PHP\php-5.2.14-Win32\php-cgi.exe
“php”表示扩展名,“PHP”是配置节名称,以“[PHP]”定义。
4. 配置 php.ini
将 C:\PHP\php-5.2.14-Win32\php.ini-recommended 复制一个,然后重命名为 D:\PHP\php.ini
打开 C:\PHP\php-5.2.14-Win32\php.ini,修改:
extension_dir = "C:\PHP\php-5.2.14-Win32\ext"
fastcgi.impersonate = 1
其它的根据实际需要对 php.ini 进行设置修改,这里只针对能跑 php,修改完记得重启 IIS。
5. 配置网站
右键网站 => 属性 => 主目录 => 配置 => 添加,如下图配置:
![](http://images.cnblogs.com/cnblogs_com/shanyou/Windows-Live-Writer/a0034df81d51_F83D/iis6fcgi_4_thumb.jpg)
可执行文件路径:C:\WINDOWS\system32\inetsrv\fcgiext.dll
6. 写个 php 测试下吧
<?php
phpinfo();
?>
看到类似以下效果说明你的服务器可以跑 php 了。
![](http://images.cnblogs.com/cnblogs_com/shanyou/Windows-Live-Writer/a0034df81d51_F83D/image_thumb_2.png)
打开后如果出现提示:No input file specified. 估计是没配置 fastcgi.impersonate。
参考 http://hi.baidu.com/imdao/blog/item/16583512f11cb654f819b858.html
Configure the FastCGI Extension for IIS 6.0
相关文章推荐
- windows2008中IIS7.5环境下 Fastcgi模式PHP配置教程
- windows+IIS 环境下以Fastcgi方式配置php 5.3.3的方法
- IIS配置Fastcgi运行php
- IIS 6下配置以FastCGI跑PHP
- IIS 6 下配置 FastCGI 的 PHP
- IIS 6 下配置以 FastCGI 跑 PHP
- IIS配置PHP5.3配置完成后---FastCGI Error14001 (0x800736b1)___解决方法
- IIS 7.5 下PHP(FastCGI模式)配置手记
- 使IIS支持PHP,ISAPI或CGI,FastCGI完全配置教程(最新php5.2.13配置方法)
- windows中IIS7配置PHP(FastCGI模式-PHP在IIS下运行最高效最稳定的模式)
- windows中IIS7配置PHP(FastCGI模式-PHP在IIS下运行最高效最稳定的模式)
- IIS 6 下配置以 FastCGI 跑 PHP
- IIS配置PHP5.3配置完成后---FastCGI Error14001 (0x800736b1)___解决方法
- 【备忘】win7下IIS 用FastCGI模块 配置PHP
- 在windows2003上部署apache+PHP遇到的部分问题(附IIS配置FastCGI驱动PHP方法)
- IIS+FastCGI+PHP5.3+MySQL5.1+Gzip配置图文详细教程
- (win7)IIS7下配置php5.3 (5.3以后的版本只可以使用FastCGI)
- windows2008中IIS7.5环境下 Fastcgi模式PHP配置教程
- 纯手工配置 IIS 6 下 FastCGI 的 PHP
- 原创教程:IIS + FastCGI + PHP5.3 + MySQL5.1 + Gzip 详细配置图文教程