windows下IIS配置PHP环境图文方法
本文章来给各位同学介绍在windows系统中iis7配置php环境的几种方法,有需要了解的朋友可参考,这里我以PHP5.2.17和PHP5.3.5 为实例,iis7配置PHP5.3.5和PHP5.2.17方法。
先到官网下载
PHP5.2.17 官方下载: http://windows.php.net/downloads/releases/php-5.2.17-Win32-VC6-x86.zip
PHP5.3.5 官方下载:http://windows.php.net/downloads/releases/php-5.3.5-Win32-VC9-x86.zip
注意了,必须都是线程安全版的了,如果是百安全测试版本的大家不要用,在服务器就要做安全版的。
在php.ini文件配置是我们如果是开发版就可随便使用那个php.ini文件了,如果是产品或服务器版本我们需要使用php.ini-production但在php5.2.17对应用文件是php.ini-recommended哦。
php.ini-production对应于php.ini-recommended
php.ini-development对应于php.ini-dist
好了注意事项都讲了,下面我来看图文教程。
首先安装好IIS7 安装的时候 要注意三个地方打得勾
注: CGI 会在IIS7+PHP_5.3.5的环境中用到
ISAPI扩展和ISAPI筛选器 用在IIS7+PHP_5.2.17
下面开始添加IIS的PHP支持
IIS7+PHP_5.3.5
1. 将下载回来的php_5.3.5解压到 C:php目录(也可以放在其他地方,但是后面应该做相应修改)
2. 将php.ini-development改名为php.ini
3. 修改php.ini 查找data.timezone 修改为date.timezone = “Asia/Shanghai”(这里必须改,不然会出警告) 找到Windows Extensions开启 所需模块,如:php_curl.dll php_mysql.dll php_mysqli.dll php_xmlrpc.dll php_curl.dll 只要去掉前面的 分号 保存就可以了
4. 添加
这里的路径按你的实际情况填写.
5. 在网站根目录新建一个phpinfo.php的文本文件 内容为:
phpinfo();
?>
6. 测试,打开浏览器看结果:localhost/phpinfo.php,如果能看到类似下面的页面就说明你成功了:
好了,到现在 已经可以成功的运行PHP程序了.
IIS7+PHP_5.2.17
于之前安装IIS的时候已经选上了isapi扩展和isapi筛选,这里就不用另外再添加角色服务了,直接开始
先修改php.ini文件..
把c:php下的php.ini-dist (需先设置显示扩展名)改名成php.ini,用记事本打开 找到extension_dir = “./”,然后把里面的./改成c:php(根据自己的实际情况修改路径)
1. 添加应用程序池
2. 添加isapi和cgi限制
3. 添加isapi筛选器
4. 添加脚本映射
5. 测试(之前已经创建了phpinfo.php) 跟之前一样 打开localhost/phpinfo.php 查看效果:
下面补充一下在apache+php配置方法
1.Apache配置PHP个人认为首先要注意的是Apache和PHP的版本信息,不同的版本之间所要进行设置的参数是不同的,开始的盲目让自己受尽了苦头。
2.选择版本:Apache 2.2.14 PHP:5.2.5 具体细节不再赘述。。。
3.验证Apache和PHP是否安装成功:
(1) Apache: http://localhost
(2)PHP:在dos窗口下运行php -i
4.PHP配置文件php.ini
(1)修改:
代码如下 | 复制代码 |
extension_dir = “./” extension_dir = "C:/Program Files/PHP/ext" (自己安装PHP的实际目录下ext子目录的路径) |
(2)取消注释以支持mysql数据库
代码如下 | 复制代码 |
extension=php_mysql.dll extension=php_mysqli.dll |
(3)环境变量:
代码如下 | 复制代码 |
PHPRC: C:Program FilesPHP Path中添加:C:Program FilesPHP |
将文件liblibmysql.dll 拷贝入C:WINDOWSsystem32
(这一步不进行可能会报Httpd.exe错误)
5.Apache配置文件httpd.conf
(1)添加对php的支持
代码如下 | 复制代码 |
LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll" PHPIniDir "C:/Program Files/PHP" |
(2)实际工作的目录:
代码如下 | 复制代码 |
DocumentRoot "F:/ApcheWork" Options FollowSymLinks AllowOverride None Order deny,allow allow from all |
(3)添加对index.php的支持
代码如下 | 复制代码 |
DirectoryIndex index.php index.html |
(4) 添加类型支持
代码如下 | 复制代码 |
AddType application/x-httpd-php .php |
友情提示,根据我们经验如果你是iis7就使用PHP5.3.5 vc9编译的,如果你是apache2.2就使用php2.1.7使用vc6编译的吧,关于这个具体可到官网去下载,

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

AI Hentai Generator
Generate AI Hentai for free.

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

The way to update ByBit exchanges varies by platform and device: Mobile: Check for updates and install in the app store. Desktop Client: Check for updates in the Help menu and install automatically. Web page: You need to manually access the official website for updates. Failure to update the exchange can lead to security vulnerabilities, functional limitations, compatibility issues and reduced transaction execution efficiency.

DeepSeek is a powerful intelligent search and analysis tool that provides two access methods: web version and official website. The web version is convenient and efficient, and can be used without installation; the official website provides comprehensive product information, download resources and support services. Whether individuals or corporate users, they can easily obtain and analyze massive data through DeepSeek to improve work efficiency, assist decision-making and promote innovation.

Detailed explanation and installation guide for PiNetwork nodes This article will introduce the PiNetwork ecosystem in detail - Pi nodes, a key role in the PiNetwork ecosystem, and provide complete steps for installation and configuration. After the launch of the PiNetwork blockchain test network, Pi nodes have become an important part of many pioneers actively participating in the testing, preparing for the upcoming main network release. If you don’t know PiNetwork yet, please refer to what is Picoin? What is the price for listing? Pi usage, mining and security analysis. What is PiNetwork? The PiNetwork project started in 2019 and owns its exclusive cryptocurrency Pi Coin. The project aims to create a one that everyone can participate

There are many ways to install DeepSeek, including: compile from source (for experienced developers) using precompiled packages (for Windows users) using Docker containers (for most convenient, no need to worry about compatibility) No matter which method you choose, Please read the official documents carefully and prepare them fully to avoid unnecessary trouble.

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

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

The official website entrance of the Coinsuper Exchange: https://www.coinsuper.com. The client download channels are: Windows client, macOS client, and mobile (iOS/Android). Registration requires an email, mobile phone number and password, and you need to complete real-name authentication before you can trade. The platform provides a variety of digital asset transactions, including Bitcoin, Ethereum, etc., with the transaction fee rate of 0.1% for both orders and acceptors. Security safeguards include cold wallet storage, dual-factor verification, anti-money laundering and anti-terrorism financing measures, and with security public

BITGet is a cryptocurrency exchange that provides a variety of trading services including spot trading, contract trading and derivatives. Founded in 2018, the exchange is headquartered in Singapore and is committed to providing users with a safe and reliable trading platform. BITGet offers a variety of trading pairs, including BTC/USDT, ETH/USDT and XRP/USDT. Additionally, the exchange has a reputation for security and liquidity and offers a variety of features such as premium order types, leveraged trading and 24/7 customer support.
