Apache程序员

wamp配置

2017-04-25  本文已影响233人  analanxingde

Wamp Server软件介绍

Wamp Server是一款功能强大的PHP集成安装环境,WampServer在windows下将Apache+PHP+Mysql集成环境,拥有简单的图形和菜单安装和配置环境。安装Wamp Server后,在右下角的托盘进行控制。Wamp Server支持多个语言,当然支持简体中文,非常方便使用。

WampServer特点:

1、支持中文语言,一键安装,省时省力;任何人都可以轻松搭建;
2、集成Apache/MySQL/PHP/PhpMyadmin;支持PHP扩展、Apachemod_rewrit
3、一键启动、重启、停止所有服务,一键切换到离线状态等等。

我的应用

新项目需要用到mysql,php,apache ,需要使用wamp(若在linux下使用lamp
wamp本身默认配置在D:wamp:www,但是我自己的项目布局在C盘下,要使得进入localhost可以获得默认的项目路径,需要进行更改。我使用的wamp版本为2.5
安装过程一路向下,安装完毕后启动wamp会看到wamp图标由红变黄再变绿,绿色代表服务三个服务(php,apache,mysql)全部启动成功,红色代表全部未启动,橙色代表部分未启动。如下图打开apache下的httpd.conf

打开配置文件.png

默认的使用记事本打开,但是我的版本默认不会换行比较乱,所以我用了notepad++打开,可以看到换行后的结果。在大约230行和252行左右找到以下内容:

#
DocumentRoot "D:/wamp/www/"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories). 
#
# First, we configure the "default" to be a very restrictive set of 
# features.  
#
<Directory />
    AllowOverride none
    Require all denied
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

<Directory "D:/wamp/www/">
    #
    # Possible values for the Options directive are "None", "All",

将其中的两个D:/wamp/www/换成自己想要的项目目录,我的是C:\Users\Administrator\PhpstormProjects,保存修改内容,并重启(点击wamp的“restart all services”),图标变绿则成功。在浏览器中输入“localhost”可以见到自己项目的本地运行结果。

上一篇下一篇

猜你喜欢

热点阅读