惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
博客园 - 聂微东
Application and Cybersecurity Blog
Application and Cybersecurity Blog
MyScale Blog
MyScale Blog
罗磊的独立博客
H
Help Net Security
L
LangChain Blog
T
Threat Research - Cisco Blogs
量子位
S
Securelist
Last Week in AI
Last Week in AI
L
Lohrmann on Cybersecurity
T
The Exploit Database - CXSecurity.com
P
Privacy International News Feed
The Hacker News
The Hacker News
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Blog of Author Tim Ferriss
T
Threatpost
Security Latest
Security Latest
P
Palo Alto Networks Blog
Microsoft Security Blog
Microsoft Security Blog
NISL@THU
NISL@THU
F
Full Disclosure
WordPress大学
WordPress大学
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Heimdal Security Blog
J
Java Code Geeks
Recorded Future
Recorded Future
Hugging Face - Blog
Hugging Face - Blog
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42
B
Blog RSS Feed
月光博客
月光博客
C
Cisco Blogs
V
Visual Studio Blog
D
DataBreaches.Net
H
Hacker News: Front Page
博客园 - 叶小钗
N
News and Events Feed by Topic
爱范儿
爱范儿
A
Arctic Wolf

博客园 - heavencoud

Dynamics NAV 的 Classic Client 和 RoleTailored Client 在应用时的区别 解决DEDECMS自由列表只能生成50页的问题 一个简单的cms构想 免费虚拟主机推荐 国外虚拟主机推荐 一个在线翻译网站。很不错。 从windows live 上面发布的日志会不会立刻被google收录呢? 关于一个个人网站的反思。 Vista64与IIS7的 一些问题,asp 以及设置上的。 (北京新娘跟妆)-看脸型做发型 Silverlight 播放器 player sharepoint 内容查询部件的定制和开发。相关链接。 moss form验证登陆过期问题 - heavencoud - 博客园 关于 列表实例 SharePoint Solution Generator 2008的 “文件或文件夹名称包含无效字符问题” Windows server2003 远程桌面播放音乐的方法! 在线考试系统,一种特殊的考试方式(在线考试系统) sharepoint new code 自定义字段类型来发收藏
IIS 6 下配置 FastCGI 的 PHP
heavencoud · 2009-06-21 · via 博客园 - heavencoud

下午在公司已经可以在 Windows Server 2008 和 IIS 7 下跑 PHP 了,家里是 Windows Server 2003 和 IIS 6 的,虽然之前也可以跑过 PHP,但觉得过程糊里糊涂,不知所以然,google 一翻,终于实现手工配置 IIS 6 下以 FastCGI 跑 PHP。回头把 IIS 7 下的实现方法也帖上。

环境:
操作系统:Windows 2003 Server SP2
PHP 版本:php-5.2.6-Win32

1.下载 FastCGI For IIS6

http://www.microsoft.com/downloads/details.aspx?FamilyID=2d481579-9a7c-4632-b6e6-dee9097f9dc5&displaylang=en

下载之后,双击运行进行安装。

安装后在 C:\WINDOWS\system32\inetsrv 目录下产生了五个文件。如下图:

同时在 IIS 的 “Web 服务扩展”里多了 FastCGI Handler。

2.下载 PHP5.25 Windows 版
http://www.php.net/downloads.php

下载 .zip 格式的版本,下载后解压至 D:\PHP 目录,并给 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.

我个人的理解是,只要“Web 服务扩展”里的 FastCGI Handler 为允许时,在加载 fcgiext.dll 时,会读取 fcgiext.ini 配置文件的内容,根据里面的配置为每个网站提供映射。

在 [Types] 下添加以下配置:

[Types]
php=PHP

[PHP]
ExePath=D:\PHP\php-cgi.exe

“php”表示扩展名,“PHP”是配置节名称,以“[PHP]”定义。

4. 配置 php.ini

将 D:\PHP\php.ini-recommended 复制一个,然后重命名为 D:\PHP\php.ini

打开 D:\PHP\php.ini,修改:

extension_dir = "D:\PHP\ext"
fastcgi.impersonate = 1

其它的根据实际需要对 php.ini 进行设置修改,这里只针对能跑 php,修改完记得重启 IIS。

5. 配置网站

右键网站 => 属性 => 主目录 => 配置 => 添加,如下图配置:

可执行文件路径:C:\WINDOWS\system32\inetsrv\fcgiext.dll

6. 写个 php 测试下吧

<?php
phpinfo();
?>

看到类似以下效果说明你的服务器可以跑 php 了。

打开后如果出现提示:

No input file specified.

估计是没配置 fastcgi.impersonate。

如果觉得过程麻烦,请看:
http://hi.baidu.com/imdao/blog/item/16583512f11cb654f819b858.html

如果你还觉得麻烦,那就到 http://www.zend.com 下载 Zend Core,这个就什么都不用配置,安装完就可以使用了,连 MySQL 都有。