一、所需软件: 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端口。
b.选择典型(Typical)安装。
c.选择安装路径。
d.安装。
e.等待安装
f.安装完成
至此,apache安装大功告成。然后测试一下:
启动服务
在浏览器输入http://localhost,显示 It Works!
2.php安装:
php解压即可。
3.mysql安装:
a.双击安装文件,选择“next”
b.选择接受安装协议,单击“next”
c.选择自定义安装(custom)
d.设置mysql安装路径:
e.接下来单击“install”
f.安装中...
g.安装完成
h.配置mysql:选择Detailed Configuration(手动精确配置)
i.选择服务器的类型,“Developer Machine(开发测试类)”、“Server Machine(服务器类型)”、“Dedicated MySQL Server Machine(专门的数据库服务器)”,我们选择Developer Machine
j.选择mysql数据库的用途,“Multifunctional Database(通用多功能型)”、“Transactional Database Only(服务器类型)”、“Non-Transactional Database Only(非事务处理型)”,我们选择Multifunctional Database
k.next
l.在打开的页面中,选择mysql的访问量,同时连接的数目,“Decision Support(DSS)/OLAP(20个左右)”、“Online Transaction Processing(OLTP)(500个左右)”、“Manual Setting(手动设置,设置为15个)这里选择手动设置,单击“next”继续
m.在打开的页面中设置是否启用TCP/IP连接,设定端口,如果不启用,就只能在自己的机器上访问mysql数据库了,默认的端口是3306,并启用严格的语法设置,如果后面出现错误,可以将“Add firewall exception for this port ”这个选项选上,单击“next”继续
n.设置mysql要使用的字符编码,第一个是西文编码,第二个是多字节的通用utf8编码,第三个是手动,我们选择utf-8,接下来单击“next”
o.选择是否将mysql安装为windows服务,还可以指定Service Name(服务标识名称),是否将mysql的bin目录加入到Windows PATH(加入后,就可以直接使用bin下的文件,而不用指出目录名,比如连接,“mysql–u username –p password;”就可以了,单击“next”
p.设置是root用户(超级管理员)的密码,并启用root远程访问的功能,不要创建匿名用户,单击“next”
q.所有的配置操作都已经完成,单击Execute按钮执行配置:
三、配置apache、php、mysql集成:
apache是通过读http.conf文件,加载modules的,下面我们把php模块添加到http.conf中,apache就能加载php模块,就完成和php的集成了。
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
b.找到
<ifmodule dir_module> DirectoryIndex index.html </ifmodule>改为
<ifmodule dir_module> DirectoryIndex index.php index.html </ifmodule>
c.修改apache站点目录。
分别找到
DocumentRoot "D:/Apache2.2/htdocs"
<directory></directory>
改为:
DocumentRoot "E:/workspace"
<directory></directory>这样以后开发的php项目就放在指定的e盘workspace中访问了。
2.修改php.ini文件:
进入php安装目录,把php.ini-development 文件改名为 php.ini作为php的配置文件。
a.指定php扩展库的路径:
搜索找到
; extension_dir = "ext"去掉前面的分号,后面的路径改为php安装路径,即
extension_dir = "E:\PHP\php-5.3.29\ext"
\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去掉前面的分号";",即为:
extension=php_curl.dll extension=php_gd2.dll extension=php_mbstring.dll extension=php_mysql.dll extension=php_xmlrpc.dll
c.设置时区:
找到
;date.timezone =改为
date.timezone = Asia/Shanghai
3.测试
在设置的站点目录“E:/workspace”中创建一个index.php文件。写入内容:
<?php phpinfo(); ?>打开浏览器出入:http://localhost/index.php。显示
往下翻页:
至此,apache、php、mysql集成就大功告成。

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

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

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver Mac version
Visual web development tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 English version
Recommended: Win version, supports code prompts!

WebStorm Mac version
Useful JavaScript development tools
