Windows IIS PHP 5.2 安装与配置方法
步骤一:下载php 5.2 for windows的安装包,解压至C:\php。注意此解压目录可以是在任何盘下,然而目录名不能包含空格;
以下是php5.2的文件目录:
c:\php
--dev
| |-php5ts.lib
--ext -- extension DLLs for PHP
| |-php_bz2.dll
| |-php_cpdf.dll
| |-..
--extras
| --mibs -- support files for SNMP
| --openssl -- support files for Openssl
| --pdf-related -- support files for PDF
| |-mime.magic
--pear -- initial copy of PEAR
|
|-go-pear.bat -- PEAR setup script
|-fdftk.dll
|-..
|-php-cgi.exe -- CGI executable
|-php-win.exe -- executes scripts without an opened command prompt
|-php.exe -- CLI executable - ONLY for command line scripting
|-..
|-php.ini-dist -- default php.ini settings
|-php.ini-recommended -- recommended php.ini settings
|-php5activescript.dll
|-php5apache.dll
|-php5apache2.dll
|-..
|-php5ts.dll -- core PHP DLL
|-...
步骤二:将c:\php目录下的php.ini-recommended(或php.ini-dist文件,官方推荐为前者)复制到当前目录,并修改文件名为php.ini;
步骤三:编辑php.ini。主要修改如下两行的值:
extension_dir = "c:\php\ext"
doc_root = "c:\inetpub\wwwroot"
修改时需要删除掉这两行行首的;注释。extension_dir的值为php安装目录下的ext目录,doc_root的值为IIS设置的主目录;
步骤四:设置环境变量。在Path后添加如下的值:
;:\php
然后重启计算机。
步骤五:打开Internet信息服务,找到“默认网站”,将网站停止。然后打开“属性”页。在“属性”页中找到“主目录”标签,单击“配置”按钮,添加应用程序映射。其值分别为:
可执行文件:c:\php\php5isapi.dll
扩展名:.php
其余不用修改,确定后,重新启动默认网站;
步骤六:在c:\inetpub\wwwroot下新建一个文件hello.php。输入内容:
保存后,打开浏览器,输入地址:http://localhost/hello.php。如果网页中显示Hello world则说明安装正确。我们也可以在网页中通过查看hello.php的源代码,如果源代码中没有php代码,也说明安装是正确的。
参考了大量别人的安装文档后自己总结的一点东西,希望对大家有用。。。。
1. php安装的二种不同模式――CGI模式和模块化安装模式
在CGI模式下,如果客户机请求一个php文件,web服务器就调用php.exe去解释这个文件,然后再把解释的结果以网页的形式返回给客户机;而在模块化中,php与web服务器一起启动并运行的,所以从某种角度上来说,以apache模块方式安装php比CGI模式更好的安全性及更好的执行效率和速度
以下例子均以php4.4.0为例,在windows xp环境下实现。
1. IIS下的安装(ISAPI模式安装)
(1) 将php压缩包解压到c:\php\下
(2) 将php.ini-dist改名为php.ini后拷贝到c:\windows下(window 2000拷贝到c:\ winnt)
(3) 把c:\php\php4ts.dll拷贝到c:\windows\system32下(不一定需要)
(4) IIS5.0的配置。打开“控制面板”=》“管理工具”=》“Internet 服务管理器”。
右键点击“默认Web站点”,选“属性”。
单击“ISAPI筛选器”标签,点击“添加”,选择c:\php\sapi的php4isapi.dll,名字取为PHP。
单击主目录下的配置按钮,在“应用程序配置”对话框中单击“添加”将出现“添加/编辑应用程序扩展名映射”对话框。点击“浏览”,选择c:\php\sapi的php4isapi.dll。扩展名.php,其它默认即可。
2. IIS下的安装(CGI模式安装)
(1) 下载php的windows安装程序php-4.4.0-installer.exe,该安装程序不包括任何外部的php扩展(php_*.dll)。
(2) 按照向导一步步安装,安装向导会收集足够的信息来设置php.ini文件,并自动配置好IIS服务器。(以apache作服务器时也可以,但不能自动配置,需手动进行)
(3) 安装完成即为IIS安装CGI模式的php。
3. Apache的安装(模块化安装模式)
以apache 2.0.55为例说明
(1) 下载apache的安装包apache_2.0.55-win32-x86-no_ssl.exe。
(2) 运行你下载的安装文件安装apache安装文件会提示你输入主机名,管理员信箱等信息,这些信息安装完后可以在httpd.conf中修改,可以放心输入。
(3) 为了方便以后的操作,建议修改默认的安装程序性路径,这里我修改为“c:”
(4) 安装完成后,需要编辑apache2/conf/httpd.conf文件。
(5) 由于IIS默认占用80端口,我们需修改ServerName为“localhost:81”(213行)及端口号为81(120行的listen 80修改为listen 81)
(6) 加载php支持的apache的模块php4apache2.dll,在134行加入“LoadModule php4_module c:/php/sapi/php4apache2.dll”
(7) 加载支持的后缀名,在757行加入“AddType application/x-httpd-php .php .php3 .php4”
(8) 添加默认识别的php文件名,找到DirectoryIndex所在的322行,添加“index.php default.php default.htm default.html”
(9) 把c:\php\php4ts.dll拷贝到c:\windows\system32下(一定)
(10)打开开始菜单->运行,输入cmd命令
(11)进入到apache2/bin目录,运行apache –k install和apache –k start命令
(12)访问http://localhost:81显示APACHE欢迎页(apache安装成功)
(13)把要调试的php程序放到apache2/htdocs下,即可以调试php程序。
(14)也可将修改php调试程序放到自定义路径,修改httpd.conf的DocumentRoot的值即可
配置服务器的GD库支持:
1. 打开php.ini文件,找到extension=php_gd2.dll,并去掉前面的分号(555行)
2. 找到extension_dir并修改“extension_dir = "./"”为你安装php所在的extensions目录,我的是extension_dir = "c:/PHP/extensions"
3. 重启apache服务器即可

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.
