Home php教程 php手册 windows下搭建apache http server、php、mysql开发环境

windows下搭建apache http server、php、mysql开发环境

Jun 06, 2016 pm 07:53 PM
apache http server windows build

一、所需软件: 1.apache htpp server: 百度输入“apache http server”搜索即可在百度软件中心下载。或者去apache官网下载。 2.php: php官网下载 。 注意 :apache http server2.2适合php5.4及以下版本。apache http server2.4适合php5.5及以上版本。因为p

一、所需软件:

1.apache htpp server:

百度输入“apache http server”搜索即可在百度软件中心下载。或者去apache官网下载。

2.php:

php官网下载

注意:apache http server2.2适合php5.4及以下版本。apache http server2.4适合php5.5及以上版本。因为php5.5及以上版本中只有php5apache2_4.dll,没有php5apache2_2.dll,而php5apache2_2.dll是关于apache2.2的动态链接库。

VC6就是使用legacy Visual Studio 6 compiler这个编译器编译的。

VC9就是使用the Visual Studio 2008 compiler这个编译器编译的。

Non Thread Safe就是非线程安全。

Thread Safe就是线程安全。

官方并不建议将Non Thread Safe 用于生产环境,所以我们选择Thread Safe版本的PHP来使用。

3.mysql:

去mysql官网下载:http://dev.mysql.com/downloads/mysql/


二、安装:

1.apache安装:

点击安装,一路下一步。

a.填写服务器信息,其中网络域名(Network Domain)和服务器名(Server Name)都填localhost,留个邮箱;根据需要选择HTTP服务的安装方式,上方是默认80端口,可能会和Windows 7自带的IIS服务端口冲突,下方是8080端口。

windows下搭建apache http server、php、mysql开发环境

b.选择典型(Typical)安装。

windows下搭建apache http server、php、mysql开发环境

c.选择安装路径。

windows下搭建apache http server、php、mysql开发环境

d.安装。

windows下搭建apache http server、php、mysql开发环境

e.等待安装

windows下搭建apache http server、php、mysql开发环境

f.安装完成

windows下搭建apache http server、php、mysql开发环境

至此,apache安装大功告成。然后测试一下:

启动服务

windows下搭建apache http server、php、mysql开发环境

在浏览器输入http://localhost,显示 It Works!

windows下搭建apache http server、php、mysql开发环境

2.php安装:

php解压即可。

3.mysql安装:

a.双击安装文件,选择“next”

windows下搭建apache http server、php、mysql开发环境
b.选择接受安装协议,单击“next”

windows下搭建apache http server、php、mysql开发环境

c.选择自定义安装(custom)

windows下搭建apache http server、php、mysql开发环境

d.设置mysql安装路径:

windows下搭建apache http server、php、mysql开发环境

e.接下来单击“install”

windows下搭建apache http server、php、mysql开发环境

f.安装中...

windows下搭建apache http server、php、mysql开发环境

g.安装完成

windows下搭建apache http server、php、mysql开发环境windows下搭建apache http server、php、mysql开发环境

h.配置mysql:选择Detailed Configuration(手动精确配置)

windows下搭建apache http server、php、mysql开发环境

i.选择服务器的类型,“Developer Machine(开发测试类)”、“Server Machine(服务器类型)”、“Dedicated MySQL Server Machine(专门的数据库服务器)”,我们选择Developer Machine

windows下搭建apache http server、php、mysql开发环境

j.选择mysql数据库的用途,“Multifunctional Database(通用多功能型)”、“Transactional Database Only(服务器类型)”、“Non-Transactional Database Only(非事务处理型)”,我们选择Multifunctional Database

windows下搭建apache http server、php、mysql开发环境

k.next

windows下搭建apache http server、php、mysql开发环境

l.在打开的页面中,选择mysql的访问量,同时连接的数目,“Decision Support(DSS)/OLAP(20个左右)”、“Online Transaction Processing(OLTP)(500个左右)”、“Manual Setting(手动设置,设置为15个)这里选择手动设置,单击“next”继续

windows下搭建apache http server、php、mysql开发环境

m.在打开的页面中设置是否启用TCP/IP连接,设定端口,如果不启用,就只能在自己的机器上访问mysql数据库了,默认的端口是3306,并启用严格的语法设置,如果后面出现错误,可以将“Add firewall exception for this port ”这个选项选上,单击“next”继续

windows下搭建apache http server、php、mysql开发环境

n.设置mysql要使用的字符编码,第一个是西文编码,第二个是多字节的通用utf8编码,第三个是手动,我们选择utf-8,接下来单击“next”

windows下搭建apache http server、php、mysql开发环境

o.选择是否将mysql安装为windows服务,还可以指定Service Name(服务标识名称),是否将mysql的bin目录加入到Windows PATH(加入后,就可以直接使用bin下的文件,而不用指出目录名,比如连接,“mysql–u username –p password;”就可以了,单击“next”

windows下搭建apache http server、php、mysql开发环境

p.设置是root用户(超级管理员)的密码,并启用root远程访问的功能,不要创建匿名用户,单击“next”

windows下搭建apache http server、php、mysql开发环境

q.所有的配置操作都已经完成,单击Execute按钮执行配置:

windows下搭建apache http server、php、mysql开发环境windows下搭建apache http server、php、mysql开发环境


三、配置apache、php、mysql集成:

apache是通过读http.conf文件,加载modules的,下面我们把php模块添加到http.conf中,apache就能加载php模块,就完成和php的集成了。

windows下搭建apache http server、php、mysql开发环境

mpm : mutil processing module 多重处理模块

apr: 可移植运行库

1.修改apache.conf配置:

打开apache/conf目录下apache.conf文件。

a.添加php模块:

“Ctrl+F”搜索“LoadModule”在后面加上

LoadModule php5_module "E:/PHP/php-5.3.29/php5apache2_2.dll"
PHPIniDir "E:/PHP/php-5.3.29"
AddType application/x-httpd-php .php .html .htm

红色的部分改成自己php的安装路径即可。

b.找到

<ifmodule dir_module>
    DirectoryIndex index.html
</ifmodule>
Copy after login
改为
<ifmodule dir_module>
    DirectoryIndex index.php index.html
</ifmodule>
Copy after login

c.修改apache站点目录。

分别找到

DocumentRoot "D:/Apache2.2/htdocs"
Copy after login
<directory></directory>
Copy after login
Copy after login
Copy after login

改为:

DocumentRoot "E:/workspace"
Copy after login
<directory></directory>
Copy after login
Copy after login
这样以后开发的php项目就放在指定的e盘workspace中访问了。

2.修改php.ini文件:
进入php安装目录,把php.ini-development 文件改名为 php.ini作为php的配置文件。

a.指定php扩展库的路径:

搜索找到

; extension_dir = "ext"
Copy after login
去掉前面的分号,后面的路径改为php安装路径,即
extension_dir = "E:\PHP\php-5.3.29\ext"
Copy after login

\ext前面为自己的php安装路径

b.支持mysql、phpMyAdmin等:

分别找到

;extension=php_curl.dll
;extension=php_gd2.dll
;extension=php_mbstring.dll
;extension=php_mysql.dll
;extension=php_xmlrpc.dll
Copy after login
去掉前面的分号";",即为:
extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_xmlrpc.dll
Copy after login

c.设置时区:

找到

;date.timezone =
Copy after login
改为
date.timezone = Asia/Shanghai
Copy after login

3.测试

在设置的站点目录“E:/workspace”中创建一个index.php文件。写入内容:

<?php phpinfo();
?>
Copy after login
打开浏览器出入:http://localhost/index.php。显示

windows下搭建apache http server、php、mysql开发环境

往下翻页:

windows下搭建apache http server、php、mysql开发环境

至此,apache、php、mysql集成就大功告成。





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 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
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)

Lossless Scaling on Steam Deck OLED runs games at up to 2x FPS Lossless Scaling on Steam Deck OLED runs games at up to 2x FPS Aug 26, 2024 am 10:07 AM

ETA Prime recently showcased a paid software called Lossless Scaling on ROG Ally X. While it doesn't actually improve the actual gaming performance, the software enhances the experience by adding frame generation and resolution scaling. These two can

How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated? How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated? Feb 21, 2025 pm 10:54 PM

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 web version entrance deepseek official website entrance deepseek web version entrance deepseek official website entrance Feb 19, 2025 pm 04:54 PM

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.

Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node? Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node? Mar 05, 2025 pm 05:57 PM

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

How to install deepseek How to install deepseek Feb 19, 2025 pm 05:48 PM

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.

Coinsuper exchange software channel official website entrance Coinsuper exchange software channel official website entrance Feb 21, 2025 pm 10:39 PM

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 official website installation (2025 beginner's guide) BITGet official website installation (2025 beginner's guide) Feb 21, 2025 pm 08:42 PM

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.

Ouyi okx installation package is directly included Ouyi okx installation package is directly included Feb 21, 2025 pm 08:00 PM

Ouyi OKX, the world's leading digital asset exchange, has now launched an official installation package to provide a safe and convenient trading experience. The OKX installation package of Ouyi does not need to be accessed through a browser. It can directly install independent applications on the device, creating a stable and efficient trading platform for users. The installation process is simple and easy to understand. Users only need to download the latest version of the installation package and follow the prompts to complete the installation step by step.

See all articles