您的位置 首页 php

PHP环境搭建——httpd-2.4.23配置安装

1.准备安装包

我从 下载的安装包 httpd -2.4.23-win64-VC14.zip

2.解压

我解压在D盘,文件目录如下

3.修改配置文件httpd.conf

修改Apache24->conf下的httpd.conf

①修改ServerRoot的根路径:

改为

ServerRoot “d:/Apache24”

②修改ServerName你的主机名称:


#ServerName www.example.com:80

改为

ServerName www.example.com:80

③修改DocumentRoot访问的主文件夹目录

DocumentRoot “c:/Apache24/htdocs”

<Directory “c:/Apache24/htdocs”>

改为

DocumentRoot “d:/www”

<Directory “d:/www”>

我在D盘创建了名为www的文件夹,用于存放php应用程序的,相当于 wamp 集成开发环境中的www文件夹
④修改入口文件DirectoryIndex


DirectoryIndex index.html

改为

DirectoryIndex index.php index.html index.htm

⑤设定ScriptAlias的目录:

ScriptAlias /cgi-bin/ “c:/Apache24/cgi-bin/”

改为

ScriptAlias /cgi-bin/ “d:/Apache24/cgi-bin/”

⑥修改CGI directory


<Directory “c:/Apache24/cgi-bin”>

AllowOverride None

Options None

Require all granted

</Directory>

改为

<Directory “d:/Apache24/cgi-bin”>

AllowOverride None

Options None

Require all granted

</Directory>

4.安装Apache24服务

以管理员身份运行cmd,并切换到Apache24的bin目录

输入

httpd.exe -k install -n “Apache24”

cmd命令输入 services .msc

这时候httpd已经篇日志完成。

5.测试Apache

打开Apache24服务,将Apache24下htdocs中的index. html文件 复制到www目录下。

打开浏览器,在地址栏中输入 localhost /index.html回车

这是Apache 服务器配置 完成。







文章来源:智云一二三科技

文章标题:PHP环境搭建——httpd-2.4.23配置安装

文章地址:https://www.zhihuclub.com/151865.shtml

关于作者: 智云科技

热门文章

网站地图