商城首页欢迎来到中国正版软件门户

您的位置: 首页 > 文章列表 > 编程开发 > php如何设置iis,如何让IIS支持PHP

php如何设置iis,如何让IIS支持PHP

  发布于2026-07-21 阅读(0)

扫一扫,手机访问

要让IIS支持PHP,其实并不复杂。PHP安装包里面自带了一份安装说明,下面就是来自%php root%\install.txt文件中的经典方法。按照这套步骤配置IIS + PHP,基本百试百灵。当然,PHP离开MySQL就不够精彩了,有时间再搭一个MySQL,调试环境就相当够用了。虽然Windows + 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 entry to the Application Mappings; Use the path to php.exe as the Executable, supply .php as the extension, lea ve 'Method exclusions' blank, and check the Script engine checkbox.

5. 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、鼠标右键单击你的站点根节点(在控制台左侧的属性管理器中,通常显示为“默认Web站点”),在弹出菜单中选择“属性”。

4、在“主目录”选项卡中单击“配置”按钮,打开“应用程序配置”对话框。

5、进入“应用程序映射”选项卡,添加一个新项目。在“可执行文件”文本框中填入 php.exe 的完整路径(如 C:\Program Files\PHP\php.exeC:\PHP\php.exe),扩展名填“.php”,“动作”项推荐选择“全部动作”,勾选“脚本引擎”复选框。按同样的方法,也可以添加 .php3、.php4 等其他扩展名。点击确定或应用保存配置。

6、将一个 .php 文件放到 Web 服务器的根目录下,访问看看效果。当然测试时不一定非要把文件放在根目录,放在虚拟目录下也可以。

本文转载于:https://blog.csdn.net/weixin_29062865/article/details/115259271 如有侵犯,请联系zhengruancom@outlook.com删除。
免责声明:正软商城发布此文仅为传递信息,不代表正软商城认同其观点或证实其描述。

热门关注