日期:2014-05-16  浏览次数:21267 次

怎么让IIS支持PHP
php 安装包中就存在安装方法。下面资料是在 %php root%\install.txt 文件中提到的。我通常都按照这个方法配置 IIS + php ,白试百灵。当然 php 离开 MySQL 就不精彩了,有时间你在配置一个 MySQL 出来,就很够用了。 WinNT + IIS + php + MySQL 虽然在使用上没有 Linux + Apache + php + MySQL 来的高速,可是做为调试环境还是非常方便的。


IIS 4.0+ (CGI)
1. Copy the php.ini-dist to your systemroot (the directory where you installed windows), rename it to php.ini, and
edit it to fit your needs
2. Start the Microsoft Management Console (may appear as 'Internet Services Manager', either in your Windows NT 4.0
Option Pack branch or the Control Panel->Administrative Tools under Windows 2000).
3. Right click on your Web server node (will most probably appear as 'Default Web Server'), and select 'Properties'.
4. Under 'Home Directory', click on the 'Configuration' button. Add a new
5. entry to the Application Mappings; Use the path to php.exe as the Executable, supply .php as the extension, leave
'Method exclusions', blank, and check the Script engine checkbox.
6. Put a .php file under your Web server's document root and check if it works!

================================================================================

PHP 在 IIS (CGI) 中的安装 (翻译兼心得)

1、 复制 php.ini-dist 文件岛你的系统文件夹(在你安装Windows 的文件夹下,比如 C:\Windows 或者 C:\WINNT 下),将该文件改名为 php.ini , 按照你需要的配置修改文件中的设置内容。
2、 打开 "Microsoft 管理控制台" ( 也许在你的系统中被称作 "Internet 服务管理器" , 尝试打开 开始 -> 设置-> 控制面板 -> 管理工具 -> Internet 服务管理器, 在你的 Windows 2000 / XP / 2003 下)。
3、 鼠标右键单击你的站点的根目录接点 ( 显示在控制台的左侧的属性管理器中,或许在 Internet 服务管理器 -> pascal(你的机器名) -> 默认Web站点 ),在弹出菜单中选择 "属性"。
4、 在 "主目录" 选项卡中单击 "配置" 按钮,打开 "应用程序配置" 对话框。
5、 进入 "应用程序映射" 选项卡, 添加一个新的项目 用 php.exe 的全路径 (如 "C:\Program Files\PHP\php.exe" 或者 C:\PHP\php.exe) 添加到 "可执行文件" 文本框, ".php" 作为 "扩展名", "动作" 项选择 "全部" (我个人推荐), 选择 "脚本引擎" 复选框,如法炮制 可以添加一些别的扩展名支持,如 .php3 .php4 等。按确定按钮或者应用按钮保存配置。
6、 放置一个 .php 的文件在你的WEB服务器的根目录所在的文件夹下,执行一下,看看效果。

当然测试的时候不一定非要把文件放在 web 根目录下,也可以放在虚拟文件夹下测试。