Table of Contents
Windows XP 环境下安装 PHP 5.2.6.
下载 PHP 5.2.6
在 Windows XP 环境下安装 PHP 5.2.6
修改 Apache 配置文件
开启 Apache Service
测试 PHP
Home Backend Development PHP Tutorial Windows XP 环境下安装 PHP 5.2.6.

Windows XP 环境下安装 PHP 5.2.6.

Jun 13, 2016 am 10:30 AM
apache php service windows

PHP安装

Windows XP 环境下安装 PHP 5.2.6.

转换为繁体中文

该章节讲述如何在 Windows XP 环境下安装 PHP。

在安装 PHP 之前,首先确认已经安装 Apache HTTP Server。如何安装 Apache HTTP Server,参见 Apache HTTP Server 安装。

下载 PHP 5.2.6

PHP 的官方网站是 http://www.php.net/。

PHP 的下载页面是 http://www.php.net/downloads.php,请选择 Windows Binaries 下的 PHP 5.2.6 installer 链接,然后选择一个镜像站点 (比如cn2.php.net) 下载 PHP,你会得到一个名为 php-5.2.6-win32-installer.msi 的安装文件。

在 Windows XP 环境下安装 PHP 5.2.6

双击 PHP 安装文件 php-5.2.6-win32-installer.msi,你会看到如下画面:

installing php

点击 Next,开始安装,在 License 页面选择 I accept the terms in the License Agreement,如下图:

installing php

点击 Next,进入 Destination Folder 画面,如下图:

installing php

点击 Next,进入 Web Server Setup 画面,选择 Apache 2.2.x Module,如下图:

installing php

点击 Next,选择 Apache 的配置文件所在的目录,如下图:

installing php

缺省状态下,文本框里显示的是 C:\Program Files,你记得要自己通过 Browse 按钮选择 Apache 的配置文件目录。

选择好Apache 的配置文件目录之后,点击 Next,选择要安装的功能,如下图:

installing php

点击 Next,准备安装 PHP,如下图:

installing php

点击 Install 按钮,执行安装。

安装完成后,会显示安装结束画面,如下图:

installing php

点击 Finish,结束安装。

修改 Apache 配置文件

安装结束以后,我们还需要修改 Apache 的配置文件。文件路径为

C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf。

用 Notepad 打开 httpd.conf,你会注意到在文件最后有以 #BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL 为开始,以 #END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL 为结束的一段配置代码。

请将这段代码更新成:

#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALLPHPIniDir "C:/Program Files/PHP/"LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"AddType application/x-httpd-php .php#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
Copy after login

保存 Apache 配置文件 httpd.conf。

开启 Apache Service

在 Windows 开始菜单选择 Start --> All Programs --> Apache HTTP Server 2.2 --> Monitor Apache Servers,点击后,你会看到在 Taskbar 有个小红图标,双击图标打开 Apache Service Monitor 画面。

如果 Apache Service 没有启动,请点击 Start 按钮开启 Apache Service;如果已经启动,请点击 Restart 按钮重新启动 Apache Service。

测试 PHP

用 Notepad 写一个最简单的 PHP 文件,存成 test.php,保存在 Apache htdocs 目录下。

<?phpecho "Blabla.cn";?>
Copy after login

然后在浏览器中输入 http://localhost:8080/test.php,页面中应该只出现 “Blabla.cn” 字样,而不是源代码。

?作者或编者:布啦布啦 ??最近更新日期:2008-05.-16参考来源:www.BlaBla.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1673
14
PHP Tutorial
1278
29
C# Tutorial
1257
24
Composer: Aiding PHP Development Through AI Composer: Aiding PHP Development Through AI Apr 29, 2025 am 12:27 AM

AI can help optimize the use of Composer. Specific methods include: 1. Dependency management optimization: AI analyzes dependencies, recommends the best version combination, and reduces conflicts. 2. Automated code generation: AI generates composer.json files that conform to best practices. 3. Improve code quality: AI detects potential problems, provides optimization suggestions, and improves code quality. These methods are implemented through machine learning and natural language processing technologies to help developers improve efficiency and code quality.

What is the significance of the session_start() function? What is the significance of the session_start() function? May 03, 2025 am 12:18 AM

session_start()iscrucialinPHPformanagingusersessions.1)Itinitiatesanewsessionifnoneexists,2)resumesanexistingsession,and3)setsasessioncookieforcontinuityacrossrequests,enablingapplicationslikeuserauthenticationandpersonalizedcontent.

How to handle high DPI display in C? How to handle high DPI display in C? Apr 28, 2025 pm 09:57 PM

Handling high DPI display in C can be achieved through the following steps: 1) Understand DPI and scaling, use the operating system API to obtain DPI information and adjust the graphics output; 2) Handle cross-platform compatibility, use cross-platform graphics libraries such as SDL or Qt; 3) Perform performance optimization, improve performance through cache, hardware acceleration, and dynamic adjustment of the details level; 4) Solve common problems, such as blurred text and interface elements are too small, and solve by correctly applying DPI scaling.

How to use MySQL functions for data processing and calculation How to use MySQL functions for data processing and calculation Apr 29, 2025 pm 04:21 PM

MySQL functions can be used for data processing and calculation. 1. Basic usage includes string processing, date calculation and mathematical operations. 2. Advanced usage involves combining multiple functions to implement complex operations. 3. Performance optimization requires avoiding the use of functions in the WHERE clause and using GROUPBY and temporary tables.

How to uninstall MySQL and clean residual files How to uninstall MySQL and clean residual files Apr 29, 2025 pm 04:03 PM

To safely and thoroughly uninstall MySQL and clean all residual files, follow the following steps: 1. Stop MySQL service; 2. Uninstall MySQL packages; 3. Clean configuration files and data directories; 4. Verify that the uninstallation is thorough.

What are the cross-platform development environments in C? What are the cross-platform development environments in C? Apr 28, 2025 pm 09:24 PM

Cross-platform development in C is recommended to use VisualStudioCode, CLion and QtCreator. 1. VisualStudioCode is lightweight and flexible, suitable for multi-platform development, but the initial configuration is more complicated. 2. CLion integrates CMake, suitable for cross-platform projects, but licenses are expensive. 3.QtCreator supports cross-platform development, with built-in Qt library, but the learning curve is steep.

Composer: The Package Manager for PHP Developers Composer: The Package Manager for PHP Developers May 02, 2025 am 12:23 AM

Composer is a dependency management tool for PHP, and manages project dependencies through composer.json file. 1) parse composer.json to obtain dependency information; 2) parse dependencies to form a dependency tree; 3) download and install dependencies from Packagist to the vendor directory; 4) generate composer.lock file to lock the dependency version to ensure team consistency and project maintainability.

Apache's Role in Web Development: Pioneering Technology Apache's Role in Web Development: Pioneering Technology May 01, 2025 am 12:12 AM

Apache's role in web development includes static website hosting, dynamic content services, reverse proxying and load balancing. 1. Static website hosting: Apache has simple configuration and is suitable for hosting static websites. 2. Dynamic content service: Provide dynamic content by combining it with PHP, etc. 3. Reverse proxy and load balancing: As a reverse proxy, it distributes requests to multiple backend servers to achieve load balancing.

See all articles