Home php教程 php手册 如何在Windows配置整合PHP和MySQL

如何在Windows配置整合PHP和MySQL

Jun 21, 2016 am 09:00 AM
application mysql php server windows

在为用户提供动态内容方面,PHP和MySQL是一个强大的组合。这些年来,这两项产品已经跨越了它们最初的应用舞台,现在,一些世界上最繁忙的网站也在应用它们。虽然它们当初都是开源软件,只能在UNIX/Linux上运行,但经过相当一段时期的发展,它们已能在Windows平台上运行。

在本文中,我将逐步为你们说明如何在Windows环境中安装并配置这些产品。对你们中的一些人来说,本文提供的信息可能过于简单,但本文旨在完成文章标题所提出的目标,提供逐步的指导。

这个特殊的软件组合一般被称作WIMP(Windows/IIS/MySQL/PHP),仿效Linux领域内的LAMP(Linux/Apache/MySQL/PHP)。

我的实验室系统运行64位Windows Server 2003企业版。

第一步:在Windows Server 2003 R2系统上安装Application Server角色

为说明这个例子,我将用IIS作为网络服务器。你也可以选择不需要IIS的PHP、MySQL和Apache组合,但在此例中我不会使用它们。

要在系统上安装Application Server角色,点击“开始菜单”,选择“管理服务器”。在管理服务器主窗口中,点击“添加或删除一个角色”选项。(图A)

图A

把Application Server角色安装到服务器上,使它可以做网站的主机

Windows将在服务器上搜索现有的角色,提供一个角色的完整列表以进行安装。(图B)

图B

Application Server角色包括IIS和ASP.net

在服务器角色的安装过程中,系统可能要求你插入Windows Server光盘。所需的文件在光盘1中。

安装完成后,系统会更新管理服务器窗口,以反映所添加的新角色。

第二步:下载PHP和MySQL

这时,服务器已作好支持网页的准备。但由于还没有安装PHP或MySQL,网页还是静态的。在安装PHP和MySQL之前,必须从它们各自的网站下载其Windows版本。

MySQL

首先说明MySQL的安装。到本文发表时止,MySQL 5.1还处于测试阶段,5.0版本已在普遍应用。即使我要在64位的Windows上安装MySQL,我还是要下载它的32位版本。毕竟,PHP也要安装在同一台服务器上,而它在64位的硬件上还不大通用,这意味着还必须使用32位的IIS,所以没有办法完全实现64位。MySQL共有三个版本:精华版、完整版或不需要安装版本。

精华版:精华版是一个旨在满足多数用户需求的MSI安装文件。

完整版:如你所期待的,完整版比精华版包含更多组件,包括一套评测工具。

不需安装版:这个版本与完整版一样,但不包含配置向导或安装器,必须手工进行安装。

在本文中,安装精华版即可。在这种情况下,我将下载的文件命名为mysql-essential-5.0.24a-win32.msi,并保存在桌面上。

PHP

为增加网页的动态效果,特别是你希望从MySQL这样的数据库中提取信息的时候,有必要使用PHP之类的语言。PHP有两个不同的版本:4.x系列版本和5.x系列版本。如果你要用到旧网站中的脚本,可能需要使用PHP 4.x系列版本,因为5.x系列版本进行了一些修改。由于我要建立一个全新的网站,所以我使用最新的版本。到本文发表时止,最新版本为5.1.6。



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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 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)

The page is blank after PHP is connected to MySQL. What is the reason for the invalid die() function? The page is blank after PHP is connected to MySQL. What is the reason for the invalid die() function? Apr 01, 2025 pm 03:03 PM

The page is blank after PHP connects to MySQL, and the reason why die() function fails. When learning the connection between PHP and MySQL database, you often encounter some confusing things...

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

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.

How to efficiently integrate Node.js or Python services under LAMP architecture? How to efficiently integrate Node.js or Python services under LAMP architecture? Apr 01, 2025 pm 02:48 PM

Many website developers face the problem of integrating Node.js or Python services under the LAMP architecture: the existing LAMP (Linux Apache MySQL PHP) architecture website needs...

How to monitor system performance through Debian logs How to monitor system performance through Debian logs Apr 02, 2025 am 08:00 AM

Mastering Debian system log monitoring is the key to efficient operation and maintenance. It can help you understand the system's operating conditions in a timely manner, quickly locate faults, and optimize system performance. This article will introduce several commonly used monitoring methods and tools. Monitoring system resources with the sysstat toolkit The sysstat toolkit provides a series of powerful command line tools for collecting, analyzing and reporting various system resource metrics, including CPU load, memory usage, disk I/O, network throughput, etc. The main tools include: sar: a comprehensive system resource statistics tool, covering CPU, memory, disk, network, etc. iostat: disk and CPU statistics. mpstat: Statistics of multi-core CPUs. pidsta

What should I do if Beyond Compare fails to case sensitivity when synchronizing Windows and Linux files? What should I do if Beyond Compare fails to case sensitivity when synchronizing Windows and Linux files? Apr 01, 2025 am 08:06 AM

The problem of comparing and synchronizing BeyondCompare files: Case sensitivity failure when using Beyond...

How to avoid third-party interfaces returning 403 errors in Node environment? How to avoid third-party interfaces returning 403 errors in Node environment? Apr 01, 2025 pm 02:03 PM

How to avoid the third-party interface returning 403 error in the Node environment. When calling the third-party website interface using Node.js, you sometimes encounter the problem of returning 403 error. �...

How to share the same page on the PC and mobile side and handle cache issues? How to share the same page on the PC and mobile side and handle cache issues? Apr 01, 2025 pm 01:57 PM

How to share the same page on the PC and mobile side and handle cache issues? In the nginx php mysql environment built using the Baota background, how to make the PC side and...

See all articles