Microsoft IIS/PWS

本节包括针对 IIS(Microsoft Internet Information Server)的说明与提示。

警告

如果使用 CGI 方式安装,则服务器对于某些可能的攻击是开放的。请阅读 CGI 安全一章以学习如何防御这些攻击。

PHP 与 IIS 安装的通用事项

  • 首先请阅读手工安装步骤。不要跳过这一步,这里提供了将 PHP 安装到 Windows 中的极其重要的信息。

  • CGI 用户必须在 php.ini 中将 cgi.force_redirect 指令设为 0。其重要细节请阅读 FAQ 中的cgi.force_redirect。此外,CGI 用户可能需要设定 cgi.redirect_status_env 指令。在使用这些指令时,确保它们没有在 php.ini 中被注释掉。

  • PHP 4 的 CGI 文件名是 php.exe 而在 PHP 5 中是 php-cgi.exe。在 PHP 5 中,php.exe 是 CLI 版本,不是 CGI。

  • 修改 Windows 的 PATH 环境变量以把 PHP 目录包括进去。这样 PHP 的 DLL 文件,可执行文件和 php.ini 就都可以保留在 PHP 目录中而不用把 Windows 系统目录搞乱了。更多细节见 FAQ 中的设定路径 PATH

  • IIS 专用用户(通常为 IUSR_MACHINENAME)需要能够读取各个文件和目录的权限,例如 php.ini,docroot 和 session 的 tmp 目录。

  • 确保在 php.ini 中正确设定了 extension_dirdoc_root 指令的值。这些指令依赖于 PHP 被安装的系统。在 PHP 4 中,extension_dir 是 extensions 而在 PHP 5 中是 ext。因此在 PHP 5 中 extensions_dir 的一个取值例子是 "c:\php\ext",IIS 的 doc_root 的取值例子是 "c:\Inetpub\wwwroot"

  • PHP 扩展库的 DLL 文件,如 php_mysql.dllphp_curl.dll,存放于 PHP 下载的 ZIP 包中(自动安装包里没有)。在 PHP 5 中,很多扩展库都是 PECL 的一部分,可以从“Collection of PECL modules”包中下载,例如 php_zip.dllphp_ssh2.dll点击进入 PHP 下载页

  • 在定义应用程序扩展名映射时,应选中“检查文件是否存在”。以极小的性能为代价,IIS(或者 PWS)会在调用 PHP 之前检查脚本文件是否存在并选出认证方法。这意味着 web 服务器会提供一个有道理的 404 形式错误信息而不是一条 CGI 错误说什么 PHP 没有输出任何数据。

Windows NT/200x/XP 和 IIS 4 或更高版本

PHP 可以安装为 CGI 或者 ISAPI 模块。不管哪种,都需要启动 Microsoft 管理控制台(也可能是“Internet 信息服务”,在 Windows NT 4.0 Option Pack 中或者在 Windows 2000/XP 下的控制面板=>管理工具)。然后右键点击 web 服务器节点(通常为“默认网站”),并选择“属性”。

如果想用 CGI 方式,按如下方法进行:

  • 选择“主目录”,“虚拟目录”或“目录”标签页,然后进行:

  • 将执行权限改为“纯脚本”

  • 点“配置”按钮,选择“映射”标签页。点击“添加”按钮,将“可执行文件”指向适当的 CGI 文件名。例如 PHP 5 的值可能是:C:\php\php-cgi.exe。在“扩展名”中填入 .php。选择“全部动作”(或者“限制为”留空),选中“脚本引擎”。然后点击“确定”。

  • 设定合适的目录安全性(在 Internet 信息服务中完成)。如果 NT 服务器使用 NTFS 文件系统,给 I_USR_ 用户加上 php.exe/php-cgi.exe 文件所在目录的可执行权限(通过资源管理器完成)。

要用 ISAPI 模块方式,按如下方法进行:

  • 如果不想用 PHP 进行 HTTP 认证,应该跳过这一步。在“ISAPI 筛选器”标签页中添加一个新的 ISAPI 筛选器。“筛选器名称”设为 PHP,“可执行文件”设为 php4isapi.dll/php5isapi.dll 的路径。

  • 选择“主目录”,“虚拟目录”或“目录”标签页,然后进行:

  • 将执行权限改为“纯脚本”

  • 点“配置”按钮,选择“映射”标签页。点击“添加”按钮,将“可执行文件”指向适当的 ISAPI DLL。例如 PHP 5 的值可能是:C:\php\php5isapi.dll。在“扩展名”中填入 .php。选择“全部动作”(或者“限制为”留空),选中“脚本引擎”。然后点击“确定”。

  • 完全停止 IIS(NET STOP iisadmin)

  • 重新启动 IIS(NET START w3svc)

对于 IIS 6(2003 Server),打开 IIS 管理器,进入 web 服务扩展,点击“添加一个新的 web 服务扩展”,“扩展名”中输入名称,例如 PHP,再点击“添加”按钮,点击“浏览”选择要么 ISAPI 文件(php4isapi.dllphp5isapi.dll)或者 CGI 文件(php.exephp-cgi.exe)作为“文件路径”后点“确定”,然后选中“设置扩展状态为允许”并点“确定”。

要使用 index.php 作为默认文档,在“文档”标签页中选择“添加”。输入 index.php 并点“确定”。用上下箭头按钮调整顺序。这和在 Apache 中设定 DirectoryIndex 相似。

对于每个要关联为 PHP 脚本的后缀都要重复以上步骤。.php 是最常用的,此外为兼容一些遗留下来的老程序可能还需要加上 .php3

如果过些时候之后碰到 CPU 占用率达到 100%,则取消选中“缓存 ISAPI 应用程序”(“主目录”下点“配置”按钮”)。

Windows 和 PWS 4

PWS 4 不支持 ISAPI,只能使用 PHP CGI。

  • 编辑包里附上的 pws-php4cgi.reg/pws-php5cgi.reg 文件(PHP 4 在 SAPI 目录下,PHP 5 在主目录下)改为自己的 php.exe/php-cgi.exe 文件的路径。反斜线应双写,例如:[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map] ".php"="C:\\php\\php.exe"(如果用 PHP 5 则改为 C:\\php\\php-cgi.exe)。然后将此注册表文件合并入系统;鼠标双击此文件即可。

  • 在 PWS 管理器中,右键点击需要加入 PHP 支持的目录并选择“属性”。选中“执行”,并确认。

Windows 和 PWS/IIS 3

配置此服务器的推荐方法是使用随包发布的注册表文件(PHP 4 是 SAPI 目录下的 pws-php4cgi.reg,PHP 5 是主目录下的 pws-php5cgi.reg)。可能要编辑此文件已确保其中的 PHP 安装目录和扩展库目录符合用户自己的设置。或者按以下步骤手工完成。

警告

以下步骤涉及到直接操作 Windows 注册表。如果出错可能使系统不稳定,强烈建议先备份注册表。如果用户损坏了注册表 PHP 开发组不负任何责任。

  • 运行 Regedit。

  • 找到:HKEY_LOCAL_MACHINE /System /CurrentControlSet /Services /W3Svc /Parameters /ScriptMap

  • 在编辑菜单选择:新建->字符串值

  • 输入 PHP 脚本想要使用的后缀,例如 .php

  • 双击新建的字符串值并在“数值数据”栏里输入 php.exe 的路径,例如 PHP 4 是 C:\php\php.exe "%s" %s,或者 PHP 5 是 C:\php\php-cgi.exe "%s" %s

  • 对每个要关联为 PHP 脚本的文件后缀名重复以上步骤。

以下步骤不影响 web 服务器安装,仅适用于想在命令行下运行 PHP 脚本(例如运行 C:\myscripts\test.php)或者在资源管理器窗口中双击文件名就运行程序。如果更希望双击 PHP 文件名是将其调入文本编辑器,则跳过以下步骤。

  • 找到:HKEY_CLASSES_ROOT

  • 在编辑菜单选择:新建->项

  • 将新项命名为前一节设的后缀,例如:.php

  • 选中新项,在右边栏双击“默认”并输入 phpfile

  • 对每个在前一节设定的后缀都重复以上步骤。

  • HKEY_CLASSES_ROOT 下再创建另一个新建->项 并命名为 phpfile

  • 选中新项 phpfile,在右边栏双击“默认”并输入 PHP Script

  • 右键点击 phpfile 项并选择新建->项,命名为 Shell

  • 右键点击 Shell 项并选择新建->项,命名为 open

  • 右键点击 open 项并选择新建->项,命名为 command

  • 选中新项 command,在右边栏双击“默认”并输入 php.exe 的路径,例如:c:\php\php.exe -q %1(不要忘了 %1)。

  • 退出 Regedit。

  • 如果是 Windows 下的 PWS,重启动以重新加载注册表。

PWS 和 IIS 3 的用户现在就拥有了完全可运作的系统。IIS 3 用户可以使用来自 Steven Genusa 的漂亮工具来配置脚本映射。


add a note add a note User Contributed Notes
peopls at gmail dot com
06-Oct-2006 11:20
I had a big problem with this on my server, as I was not using IUSR I was using Network Service.
Even more difficult was the fact that it was the DC on a domain which meant I got told that  it "is not from a domain listed in the Select Location dialog box, and is therefore not valid.".
The way I got around this was with the following command.
C:\Documents and Settings\Administrator>cacls C:\php /G "NT AUTHORITY\NETWORK SERVICE":F /E /T

Please note that this gives the user NETWORK SERVICE full access to the C:\php directory, but it did solve my problem!
Rex Hunt
07-Sep-2006 09:30
Found this PHP installer for IIS which uses fastcgi and apc;

http://www.iis-aid.com/iis_aid_php_installer

You get to configure your fastcgi and apc settings during installation, and it is meant to work with IIS 5.x and 6. It even setup the web server extension in IIS 6, and seems to be working ok for me so far on a dev box. Only drawbacks are it is only available with PHP 4.4.1 using fastcgi (no isapi yet).
sschefer at scheferonline dot net
29-May-2006 02:56
I have sucessfully installed PHP 4 and 5 on every windows server version since 2000 (not NT4) and XP. It is simple but there are a couple of pre-requisites that I've never seen mentioned.

1. Most of the problems folks are experiencing on the server side are .NET 2.0 induced. If you must run .NET 2.0 then you need dll's that were compiled with Visual Studio 8. The big push behind VS.8 and the Express editions is to get you off of PHP and onto C#. Keep that in mind when you develop apps.

2. You can run .NET 2.0 and Visual studio on XP with PHP and IIS if you install Visual Studio first. Visual studio installs its own dedicated version of IIS that works with .NET 2.0 but will not run php. After VS is installed go ahead and install the included XP version of IIS and configure your virtual sites with PHP. If you do it the other way around, VS will incorporate itself into the xp IIS and your PHP will probably not run.

3. Put the PHP ini file where windows wants it, in the (system root) "c:\windows" dir. If you do that,  and you are using only the ISAPI dll's, you just need to change the ini file to point to the ext directory correctly and it will run fine. I usually do all the pathing recommendations and set phprc=(php directory) too. I also leave a copy of the current ini file in the php directory root just incase php forgets to consult with the OS before looking for something.

Most of the problems with permissions are comming from .NET 2.0. You should never have to weaken security to get PHP to run.

4. Slightly out of scope but important nonetheless. If you do not run .NET 2.0, the ordering of your extensions (ie..mysql.dll, etc.) becomes far less important. You may see a hang occasionally but its rare.

Hope this helps someone.
Steve
legolas558_AT_users dot sourceforge.net
13-May-2006 12:07
How to solve the nasty "permission denied" under IIS (Windows xp)

From http://www.geocities.com/legolas.1558/php_iis_permission_denied.htm

   1. Did you disable Simple File Sharing? From any folder click Tools -> Folder Options -> View (tab)-> (scroll the list and find "Simple File Sharing (reccomended)") UNTICK IT
   2. Locate your localhost root directory, usually C:\InetPub\wwwroot\
   3. Open the Properties of the whole directory, in our case wwwroot
   4. Click the Protection tab(where to manage user rights)
   5. Click Add and then click Advanced (button in the bottom-left part of the window)
   6. Click Find (the only enabled button between Columns and Stop)
   7. Pick the user that starts with IUSR_ (which is the IIS default user) from the list Windows has kindly found for you
   8. push OK twice
   9. the new added IUSR_ will be selected, from the Authorizations list check Edit (to allow file creation/deletion) and Write (to allow file modify)
  10. click OK one more time to get back to your native folder
EvilPuppetMaster
24-Mar-2006 11:39
After having recently gone through a long process of trial and error installing both php4 and php5 on a single machine under IIS. I eventually did get it working so I thought I'd share what I learnt.

Basically, as far as I can tell there is no way to get both versions working using the ISAPI dlls unfortunately. You can however get them working using one as ISAPI and the other as CGI. And probably both as CGI too, although I didn't try that.

You'll need to know how to do a manual install of PHP anyway, see the instructions for how to do that. Make sure you follow the steps about your PATH env variable and Allowing extensions on IIS 6. Keep your php.inis in the relevant php directory and make sure they are not in your windows or system32 folders. And all that other hoopla.

The crucial part is your php.ini files. The problem being that both versions will look at your PHPRC setting and get the ini file path from that. So you'll end up with both versions running off the same INI which is no good. The way around this is to use the CGI for one version and ISAPI for the other.

The ISAPI dll never seems to look in it's own directory for the ini file, but the CGI exe does. You can use that quirk to your advantage by naming the INI file for the ISAPI version 'php-isapi.ini' and setting the PHPRC environment variable to that path. Then for the CGI version keep the php.ini in the same directory as php.exe.

Then set your virtual server to use either the ISAPI module for one version, or the CGI module for the other version, and it should work. Test using phpinfo() to ensure each version is getting it's ini file from the correct place.

Basically it seems that the ISAPI module will look in the path set in PHPRC first, and choose the php-isapi.ini file. The CGI module will look in PHPRC first too, but it upon seeing no php.ini it will then move on to search it's own directory, where it finds php.ini.
Martu
24-Mar-2006 09:07
I have fixed the 404 with this message found at google groups:

-----------------------------------------------------------
I could not get PHP pages to display in IIS 6 with Windows 2003, using the
default install of the stable binaries from php.net.

Here is the solution I found.

The default install registers the .php extension as belonging to
c:\php\php.exe.  This is correct, but it's faster to use the ISAPI
extension.

To do this,
1. Open the IIS Management console
2. Expand the server, right click on "Web Sites" and click Properties
3. Open the "ISAPI Filters" foldertab
4. Click Add
5. Enter PHP in the Filter Name box.
6. Click Browse and then Browse to your php4isapi.dll.
6. Click ok -> Apply -> ok

... Once this is completed, your PHP scripts still won't run.  The problem
is that you have to define and enable PHP as a "Web Service Extension".

To do this,
1. Open the IIS Management console
2. Expand the server, and expand the "Web Services Extensions"
3. Click "Add a new Web services Extension"
4. Enter PHP in the Extension Name box.
5. In the required files box, Browse to your php directory and add
php4isapi.dll.
6. Click ok -> Apply -> ok

Last but not least, You may or may not need to do the following,
-Set the extensions path in the php.ini file if you are going to use any
extensions , i.e.  php_mssql.dll
-I had to copy the php4isapi.dll from c:\php\isapi to c:\php, YMMV
-Give the webserver user (IUSR_MACHINENAME in most cases) read and execute
access to php4isapi.dll and php4ts.dll

Good Luck,
Ejay Hire
EjayH...@hotmail.com
----------------------------------------------------------
paul_noeldner at hotmail dot com
04-Oct-2005 10:58
PROBLEM
   PHP $DOCUMENT_ROOT was not set in IIS. 
ANALYSIS
   A Google search turned up a suggestion re using ISAPI instead of CGI. 
SOLUTION
I did the fix per these suggested steps from Google search:
1 Downloaded PHP5 zip
2 Added ISAPI filter PHP5ISAPI.DLL named PHP
3 Changed document type .php to point at the PHP5ISAPI.DLL file instead of PHP.EXE.
RESULT
This worked - the php pages started picking up $DOCUMENT_ROOT as expected.
General suggestion: Don't waste time with CGI, use ISAPI.
Jamez
23-Sep-2005 08:29
PHP 5, IIS 5, Win XP:

One thing to note: if you run phpinfo() and the 'Configuration File (php.ini) Path' points to a directory and not the actual file (ie. C:\\windows instead of C:\\windows\\php.ini) this means that it is not using your php.ini file, it is using default settings.

After spending hours searching forums the only thing that got it to work for me was to create a new environment system variable called 'PHPRC' and set it to the path where your php.ini is located (ie C:\\PHP) - simply adding C:\\PHP to the system path variable didn't do it. You have to reboot after this change of course. I'm not sure why this isn't more documented as from my searching there are quite a few people who experience this problem... hope this helps!
webwhammy.com
16-Sep-2005 07:53
After installing PHP and running an http://localhost/test.php file in my browser, I encountered a COM Surrogate error. After some testing, I found that it was a result of un-checking the Cache ISAPI applications checkbox. Consequently, make sure that the Cache ISAPI applications checkbox has a check in it. To get to the checkbox go to:

Control Panel>Administrative Tools>Internet Information Services

When you are at the IIS window in the left navigational panel go to:

Local Computer>Web Sites>Default Web Site

Right-click on your default web site and select Properties. A Properties window appears. Select the Home Directory tab. Click on the Configuration... button. A Configuration window appears. Below the Mappings tab is the Cache ISAPI applications checkbox.

Again, make sure that the Cache ISAPI applications checkbox has a check in it. I hope this helps anybody else with a similar problem.
Mac Rinehart
08-Sep-2005 12:14
"Click on the 'Configuration' button, and choose the Application Mappings tab. Click Add and set the Executable path to the appropriate CGI file. An example PHP 5 value is: C:\php\php-cgi.exe Supply .php as the extension. Leave 'Method exclusions' blank, and check the 'Script engine' checkbox. Now, click OK a few times."

When installing PHP 5 on IIS 6.0 and Windows 2003 I encountered problems with this instruction. I  believe the root cause is that IIS requires the "scripts and executables" execute permission to be selected if the script engine has a .exe extension.

However, there may have been additional problems. Even when selecting the "scripts and executables" execute permission I continually received HTTP Header errors. The resolution was to follow the instructions for use of php5isapi.dll. The .dll extension can be run with the "scripts only" execute permission. Also remember IIS 6.0 requires that you identify Web Extensions and Allow execution of those extensions.
peter at peterguy dot com
01-Apr-2005 02:43
Installing PHP 5 on Windows Server 2003/IIS6

It has come to my attention that the link to my PHP installation guide in my posting of 07-Feb-2005 11:49 is a Bad Link.
We don't like Bad Links.

Here's the correct one:

http://www.peterguy.com/php/install_IIS6.html

Enjoy!

-Peter
Marat
17-Mar-2005 05:50
The correct required NTFS ACL's are:

- for the folder holding your PHP files:
   [Read] IUSR_servername
   [Read] IWAM_servername

-for the folder holding the PHP executables:
   [Read] IUSR_servername
Person who wants ISAPI version installer
25-Feb-2005 05:59
Supplementation to the previous hint

The environment is Windows 2003 Server/IIS 6/PHP 5.

About IIS 6 of Windows XP.

 There is no 'IISEXT.VBS'.
 It seems not to have to add it to the Web enhancing
 (It is not an accurate intelligence ).
 Moreover, when the method argument of iis6
 isapimap add is omitted, it becomes an error.
 Specify it following and specifying it.

   iis6isapimap add .PHP C:\PHP\php5isapi.dll GET,POST,HEAD

Good Luck !
Person who wants ISAPI version installer
24-Feb-2005 05:34
Hint registered to IIS 6 as ISAPI without using GUI.
(It is a machine translation from Japanese to English. )

[Method of addition to Web enhancing]

'IISEXT.VBS' is attached to IIS 6.

  <addition example>

   iisext /AddFile C:\PHP\php5isapi.dll 1 PHP 1 "PHP: Hypertext Preprocessor"

  <deletion example>

   iisext /RmFile  C:\PHP\php5isapi.dll

[Method of adding extension to Application Mappings]

To our regret, there is no good method in the standard. :-(
The source code of C# program that is registered and deleted is presented in the mapping.
(It is hoped that someone writes VBScript or the JScript version)

  <addition example>

   iis6isapimap add .PHP C:\PHP\php5isapi.dll

 < deletion example>

   iis6isapimap delete .PHP

C# source code
(Add 'System.DirectoryServices' to the reference)
------------------------------------------------------------
using System;
using System.Collections;
using System.DirectoryServices;

namespace IIS6ISAPIMAP

{
   class StartClass
   {
       public static void print_man()
       {
           Console.WriteLine("IIS6ISAPIMAP [view|add|delete] <.ext> <ISAPI DLL PATH> (METHOD LIST)");
       }

       [STAThread]
       static void Main(string[] args)
       {
           if ( args.GetLength(0) < 1 )
           {
               print_man();
               return;
           }

           System.DirectoryServices.DirectoryEntry dent
               = new DirectoryEntry("IIS://localhost/W3SVC/1/root"); 
           ArrayList orglist
               = new ArrayList( dent.Properties["ScriptMaps"] )  ;

           if ( args[0].ToLower() == "view" )
           {
               foreach(string s in orglist)
               {
                   Console.WriteLine(s);
               }
           }
           else if ( args[0].ToLower() == "add" )
           {
               if ( args.GetLength(0) < 3 )
               {
                   print_man();
               }
               else
               {
                   ArrayList newlist = new ArrayList();
                   string ext = args[1];
                   string path = args[2];
                   string methods = args.GetLength(0) < 4 ? "" : args[3];
                   string newmap = ext + "," + path + ",5," + methods;

                   foreach(string s in orglist)
                   {
                       string [] tokn = s.Split(',');
                       if ( tokn[0].ToLower()  != ext.ToLower() )
                       {
                           newlist.Add( s );
                       }
                   }
                   newlist.Add( newmap );

                   dent.Properties["ScriptMaps"].Value = newlist.ToArray();
                   dent.CommitChanges();
               }
           }
           else if ( args[0].ToLower() == "delete" )
           {
               if ( args.GetLength(0) < 2 )
               {
                   print_man();
               }
               else
               {
                   ArrayList newlist = new ArrayList();
                   string ext = args[1];

                   foreach(string s in orglist)
                   {
                       string [] tokn = s.Split(',');
                       if ( tokn[0].ToLower()  != ext.ToLower() )
                       {
                           newlist.Add( s );
                       }
                   }

                   dent.Properties["ScriptMaps"].Value = newlist.ToArray();
                   dent.CommitChanges();
               }
           }
           else
           {
               print_man();
           }

           dent.Dispose();
       }
   }
}
php at at dougdossett dot com
07-Jan-2005 03:05
I had problems upgrading to 5.0.3 isapi on my IIS 6/Windows 2003 server.  Most of the instructions I found said to give the IUSR account access to various files/folders.  In my case I needed to give access to "Network Service" (not to be confused with just "Network"). 

1. In IIS Admin, go to Application Pools
2. Right click on the pool your site is running under and click properties. 
3. Go to the Identity tab and see what user is selected. 
4. Give that user permissions to your php files/directory.

Don't know if this will help anyone else, but thought I'd offer in case.
megawhizzz at netscape dot com
12-Oct-2004 07:19
Path references (e.g. for browscap.ini) in php.ini MUST be enclosed with double-quotes (") instead of single-quotes(') for PHP to load correctly under IIS
paul at heisholt dot net
31-Aug-2004 04:43
There's a bug in IIS 5.1 which may prevent you from adding an Application Extension Mapping. If the OK button remains disabled after you've entered the Executable and the Extension, try this workaround provided by Microsoft:

1. Right-click the individual Web site or the Web Sites folder, and then click Properties.
2. On the Home Directory tab, click Configuration.
3. Under Application Configuration, click Add, and then click the Mappings tab.
4. With the Add/Edit Application Extension Mapping dialog box open, click Browse to select the .exe file or the .dll file from the local path on the Web server.

Note:
You must type the path to a valid file in the Executable text box or the OK button remains unavailable. The easiest way to make sure that you enter a valid path is to select the file by using the Browse button.

5. After the path appears in the Executable text box, click in the Executable text box to initialize the path.

6. Click in the Extension space, and then type the file name extension.

Note:
- You must enter the period (.) in front of the extension in the Extension text box, or the OK button remains unavailable.

7. When the OK button becomes active, click OK to continue.

Source: http://support.microsoft.com/?id=317948

-paul-
webmaster at avalon dot de
13-Aug-2004 10:55
If you use IIS6 you have to add a new Webextension for PHP to work, otherwise you will get a "404"-Page if you try to point your browser to a "*.php" file.
In order to do this you have to open the IIS-management console and open the "local computer".
Under "webextensions" you will find allready a list with different extensions all being blocked by default.
To get PHP to work you have to manually add a new webextension. I only have a german version of IIS in front of me so forgive me if i translate the buttons wrongly.
Click on "New webextension". Enter any name you like for your new extension. Click on "Add..." and then on "Search...". If you would like to add the DLL just browse to your PHP-directory and you will find the php5ts.dll. If you search for the php-cgi.exe you have to change the filetype at the bottom to "CGI-Exe-Files". Only after changing the filetype you can see the php-cgi.exe file and choose it for the extension.
If you check the checkbox at the bottom of the "New extension" Window it will allow the newly added extension to be executed. Certainly you can change the status any time you want by clicking on "Allow".
Only after that procedure you will be able to get in touch with PHP-files.

sincerely
Juergen Sommer
venimus at mail dot com
07-Jun-2004 10:57
Under IIS6 (and earlier)
After all the installation, do not forget to add "index.php" as default page, under the Documents tab in the Web Site's Properties.
1. Right-click Web Sites, choose Properties
2. Click Documents tab
3. Click Add...
4. Type index.php, click Ok
5. Choose "index.php" from the list and move it to the top using Move Up button.
6. Make sure "Enable default content page" is checked.

Ofcourse you can add other pages as default.

For those that do not know what is this for: If you do not provide full URL and you have several pages in the directory which are in this list, the server will return the topmost of them. In case you wish to open other page of them, you have to provide its full URL. Putting "index.php" on top will make sure no other pages will be returned as default.
jorrit at gameparty dot net
02-Jun-2004 07:33
If you experience extreme high loading times, please have a look at this http://bugs.php.net/bug.php?id=28524
tstirrat AT optusnet DOT com DT au
21-Apr-2004 11:14
I am running Active Directory & IIS6.0

I found that after looking through the tutorial below i was still unable to get into my site (authentication popup, 401.3 error). I set my permissions for read & execute for IUSR_(server) and IIS_WPG for both my document root and the php directory.. no luck.

However, here's how i solved the problem. (I believe this solution is relevant to fixing the active directory issue)

1. You want to give the IUSR_* and IIS_WPG read & execute permission to the PHP DIRECTORY ONLY. (I managed to remove the credentials from my document root and it still works.

2. Open IIS Manager and go to Application Pools, then to the pool which is relevant to your site (in my case DefaultAppPool).. on this item, right click and choose properties.

3. Now navigate to the identity tab.

4. My Worker process was set to Predefined: Network Service. I changed this to Configurable: IWAM_(server name) (which if you noticed is in the user group 'IIS_WPG')

Note: i also changed the passwords for my IUSR_* and IWAM_* accounts to be sure they werent set to something easy by default. Its probably a good idea to do this too.

Hope this solves someones frustration.
giunta dot gaetano at sea-aeroportimilano dot it
12-Feb-2004 09:32
If some extensions (such as OCI or Turck mmcache in FastCGI mode) have trouble functioning with PHP+IIS, make sure that "Allow IIS to Control Password" is unchecked in the preferences panel for anonymous user access.

For more detail on the issue, read articles 216828 and 218756 in the MS Knoweledge Base.
Aaron Blew
12-Feb-2004 04:24
Under IIS 6, don't forget that you have to add all the PHP modules you'd like to run to the PHP Web Service Extension part under the IIS management console.
webmaster at riachao dot com
12-Aug-2003 09:49
In the installation with IIS 6.0, after you add the isapi extension, you need to allow the extension in the Web Services Extensions, or you 'll get a 404 error.
nbrookins at cbwstores dot com
11-Apr-2003 12:16
On Windows Server 2003 (formerly .net server) with IIS 6 (final RTM - build 3790)

 I got PHP working by using one of the tips above (thanks!). 

I noted however, that I did not need to 'allow unknown Isapi applications' , and I was able to keep the configuration at 'Scripts Only' instead of 'Scripts and Executables'  - both settings are potentially more secure this way.

The only configuration that is different from how I normally configure PHP on IIS 5 is the addition of PHP as a Web Service Extension.
jdogg00 at msn dot com
04-Nov-2002 12:50
Here's a quick fyi, to get PHP installed on .Net Server w/ IIS 6 you have to use the IIS manager to enable support for different web service extentions. CGI ,ASP, ISAPI are all prohibited by default. In IIS manager click on the Web Service Extentions Folder there's options to add a new extention , prohibit all extentions etc. I chose add new extention ,in the dialog box I named it PHP , click add , in the next dialog browse to path of 'php4isapi.dll' hit ok then mark checkbox "Set extention status Allowed"  hit ok and all is good. This was done after I followed the install.txt for IIS 4 or newer .
greg at wfrmls dot com
23-Jan-2001 01:12
When using WindowsNT 4.0 and IIS, the WWW home directory needs to have Read AND Execute access rights.