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

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
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
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
1664
14
PHP Tutorial
1269
29
C# Tutorial
1248
24
How to run sublime after writing the code How to run sublime after writing the code Apr 16, 2025 am 08:51 AM

There are six ways to run code in Sublime: through hotkeys, menus, build systems, command lines, set default build systems, and custom build commands, and run individual files/projects by right-clicking on projects/files. The build system availability depends on the installation of Sublime Text.

How to solve complex BelongsToThrough relationship problem in Laravel? Use Composer! How to solve complex BelongsToThrough relationship problem in Laravel? Use Composer! Apr 17, 2025 pm 09:54 PM

In Laravel development, dealing with complex model relationships has always been a challenge, especially when it comes to multi-level BelongsToThrough relationships. Recently, I encountered this problem in a project dealing with a multi-level model relationship, where traditional HasManyThrough relationships fail to meet the needs, resulting in data queries becoming complex and inefficient. After some exploration, I found the library staudenmeir/belongs-to-through, which easily installed and solved my troubles through Composer.

laravel installation code laravel installation code Apr 18, 2025 pm 12:30 PM

To install Laravel, follow these steps in sequence: Install Composer (for macOS/Linux and Windows) Install Laravel Installer Create a new project Start Service Access Application (URL: http://127.0.0.1:8000) Set up the database connection (if required)

git software installation git software installation Apr 17, 2025 am 11:57 AM

Installing Git software includes the following steps: Download the installation package and run the installation package to verify the installation configuration Git installation Git Bash (Windows only)

Can vscode be used on mac Can vscode be used on mac Apr 15, 2025 pm 07:45 PM

VS Code performs well on macOS and can improve development efficiency. The installation and configuration steps include: installing VS Code and configuring. Install language-specific extensions (such as ESLint for JavaScript). Install the extensions carefully to avoid excessive startup slowing down. Learn basic features such as Git integration, terminal and debugger. Set the appropriate theme and code fonts. Note potential issues: extended compatibility, file permissions, etc.

vscode sets the header file path vscode sets the header file path Apr 15, 2025 pm 09:24 PM

To set the header file path in Visual Studio Code, open the User Settings panel, add the path in the Include Path field, and click the Save button. Example: { "includePath": ["/path/to/header1", "/path/to/header2"] }.

What is git software for? How to use git software? What is git software for? How to use git software? Apr 17, 2025 pm 12:09 PM

Git is a distributed version control system designed to track code changes and allow collaborative development. It enables developers to document project evolution, manage code merges, and maintain project history in an efficient and secure way. Through Git's distributed architecture, each developer has a complete copy of the project and performs common version control operations without communicating with a central server.

git software installation tutorial git software installation tutorial Apr 17, 2025 pm 12:06 PM

Git Software Installation Guide: Visit the official Git website to download the installer for Windows, MacOS, or Linux. Run the installer and follow the prompts. Configure Git: Set username, email, and select a text editor. For Windows users, configure the Git Bash environment.

See all articles