Apache+php5

1.下载回来的是解压文件,解压好放到要安装的位置。(我这里以D:\Acpache24为例) 

2.打开Apache24\conf下httpd.conf 文件,用记事本打开即可。 

(1)第37行ServerRoot "c:/Apache24"改为ServerRoot “D:/Apache24”;//Apache程序的位置。 
2)第204行的ServerAdmin改不改无所谓; 

(3)第213行ServerName前面的“#”号去掉; 

(4)第237行DocumentRoot "c:/Apache24/htdocs"改为DocumentRoot "D:/www"//网站的根目录 

        第238行<Directory "c:/Apache24/htdocs">改为<Directory " D:/www ">; 

注意:这个WWW文件夹要自己去新建的,不建的话会报错的。 

(5)第271行DirectoryIndex index.html改为DirectoryIndex index.html index.php index.htm   //支持更多的默认页 
6)第354行 ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/"改为ScriptAlias /cgi-bin/ "d:/Apache24/cgi-bin/"7)第370行<Directory "c:/Apache24/cgi-bin">改为<Directory "D:/Apache24/cgi-bin"> 

安装到服务里

这里加入服务的命令为:httpd.exe -k install -n "servicename" 

装载PHP模块

# php5 support
LoadModule php5_module "d:/php/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "d:/php"

 

posted on 2014-05-25 10:44  ~紫鱼~  阅读(198)  评论(0编辑  收藏  举报