apache+mysql+php配置

本文介绍的是windows下配置apache+mysql+php
一、清理电脑 查看端口
清理电脑主要是卸载安装好的apache、mysql、php
查看端口打开cmd 输入netstat -nao
主要是看80端口有没有被占用,如果被占用,停掉软件或者修改默认端口
二、安装apache+mysql+php
最好都安装在c盘根目录下
安装MySQL
cmd中输命令就行
cd mysql所在的目录输入mysql --install
安装Apache
需要输入就输入
两个127.0.0.1
 测试web server方法:在地址栏使用你设定的127的访问网址
 http://127.0.0.1/1.html (htdocs就是默认网站目录)
安装PHP
三、协同配置
1、对于Apache主配置文件httpd.conf的修改。
D:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf
(1) DocumentRoot "e:/source"
(2)
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# https://www.360docs.net/doc/b75638559.html,/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride all

#
# Controls who can get stuff from this server.
#

# onlineoffline tag - don't remove
Order Allow,Deny
Allow from all


把directory后面的路径改为项目所在路径e:/source
(3) DirectoryIndex 在后面添加上index.php
(4) 去掉Include conf/extra/httpd-vhosts.conf 前面的#号
也就是去掉注释,使其起作用
(5)复制三行代码至页面的底部
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "c:\php"
************
修改httpd-vhosts.conf
复制出来一段,然后修改如下:

DocumentRoot "e:/source/web"
ServerName https://www.360docs.net/doc/b75638559.html,

************************
修改域名映射文件
c:/windows/system32/drivers/etc/hosts
加入一行:127.0.0.1 https://www.360docs.net/doc/b75638559.html,

2、对于PHP主配置文件php.ini的修改
C:\php\php.ini
把文件php.ini-development复制一份,改名为php.ini
(1)、找到并修改为:extension_dir = "c:/php/ext" (注意去掉分号)
(2)、去掉三个分号:
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mysql.dll

3、对于MySQL部分的文件调整
复制一个挂钩文件(dll动态链接库文件)。
在mysql\bin目录下,找到libmysql.dll,然后复制到c:/windows/system32下面

相关主题
相关文档
最新文档