Apache2.2 + php5配置

  网上有很多类似的配置说明帖子,此处纯记录自己动手结果。

 

1,下载安装Apache2.2,打开/conf/httpd.conf文件

  1.1,添加对php5的支持(我的php解压在目录:D:/SOFT/DEVELOP/php-5.4.3),在http.conf文件中添加两行:

#LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule php5_module "D:/SOFT/DEVELOP/php-5.4.3/php5apache2_2.dll"
AddType application/x-httpd-php .php

  说明:php5apache2_2.dll是php5对apache的支持的动态链接库(dll),LoadModule命令用于开启httpd服务时加载欲用到的动态库,所以修改了这个配置之后需要重启Apache httpd服务。php5_module必须是这个词,别的名字会报错。暂时还不知道是怎么规定的。

 

  1.2,修改网站位置:

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "D:/WEB"
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "D:/WEB">
    #
    # 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.

  这样就可以把自己写的网页文件放到指定的位置了——D:/WEB。

 

posted @ 2014-04-14 22:20  Charlie123  阅读(369)  评论(0编辑  收藏  举报