浅析iis7.5安装配置php环境
浅析iis7.5安装配置php环境
windows server 2008 和 windows server 2003 是目前国内比较主流的服务器操作系统,其搭建php的环境也是多种多样,其中IIS+Fastcgi+php+mysql安装是最简单的。
iis7.5是安装在win7、win8里的web服务器,win2003、win2000的web服务器使用的是iis6.0,由于win7、win8系统相比win2003、win2000有了改新革面的不同,因此对于iis7.5的配置也必需捣鼓一翻才能熟悉。不过这些都是操作性的东西,就如当初第一次接触iis6.0那样,操作过几遍就慢慢熟悉了。
当下我需要web服务器运行php程序,因此要配置一下php环境。一开始以为比较容易,因为在iis6.0里配置了无数次了,星外PHP全自动安装30秒轻松搞定,但是当打开iis7.5后,才发现原先iis6.0的熟悉的东西大部分在iis7.5里找不到了,不得不摸索一翻。本文结合自己的实际经验,介绍一下如何在iis7.5安装配置php。
1.准备文件
首先确保你已经下载并且解压了php程序文件,如果还没有,先下载一个。php程序文件是不需要安装的,把下载的压缩包解压到任何一个文件夹里即可。本案例里使用的是PHP 5.2.13。
官网下载Php执行文件:http://windows.php.net/download/
2.IIS配置2.1 添加ISAPI筛选器
进入“控制面板”-“程序”-“打开或关闭Windows功能”,展开“Internet信息服务”,然后勾选“ISAPI筛选器”,最后点击“确定”按钮,如下图所示:
图1:打开ISAPI筛选器
2.2 设置ISAPI2.2.1 打开IIS管理器
进入IIS管理器(方法:右键点击“计算机”,再点击“管理”,在弹出界面里展开“服务和应用程序”的项目,然后双击“Internet 信息服务(IIS)管理器”),进入IIS管理界面,如下图。
图2:打开IIS管理器
2.2.2 添加PHP的ISAPI路径
在上图2中,双击“ISAPI和CGI限制”的图标,之后进入设置界面,如下图。
图3:添加PHP ISAPI
如上图3所示,点击“添加”,在弹出窗口里输入php的ISAPI路径,也即是php解压包的php5isapi.dll的文件路径,描述文字随意填写,如“php”,勾选“允许执行扩展路径”,然后点击“确定”。
2.2.3 添加PHP的处理程序映射
点击一下计算机名称(更正:应该是点击“网站”下面的需要设置的网站名称,而不是最顶部的计算机名称,这个设置是针对某一个网站的),会看到右侧的“IIS”下面有个“处理程序映射”的图标,如下图。
图4:IIS处理程序映射
双击“处理程序映射”的图标,就进入设置界面,如下图:
图5:添加PHP处理程序映射
在设置界面里点击“添加脚本映射...”,然后在弹出窗口里填写相应的内容,请求路径是“*.php”,可执行文件是php解压包的php5isapi.dll的文件路径,跟图3填写的路径一样。名称随意,可填“php”,请求限制不用设置,点击“确定”添加完毕。
2.2.4 测试Php
用记事本输入以下几行代码:
?
1 2 3 |
phpinfo(); ?> |
保存为:info.php,放到网站目录下,然后启动浏览器,访问 http://localhost/info.php,如果看到如下画面就证明安装成功了!
图6:php运行成功界面
以上所述就是本文的全部内容了,希望大家能够喜欢。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

If you are an experienced PHP developer, you might have the feeling that you’ve been there and done that already.You have developed a significant number of applications, debugged millions of lines of code, and tweaked a bunch of scripts to achieve op

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.
