帮助中心 >  技术知识库 >  网站相关 >  网站运营 >  PHP环境搭建——httpd-2.4.23压缩包配置安装

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

2016-11-19 03:37:20 7701

1.准备安装包

我从https://www.landui.com/下载的安装包httpd-2.4.23-win64-VC14.zip

PHP环境搭建——httpd-2.4.23配置安装2.解压

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

PHP环境搭建——httpd-2.4.23配置安装3.修改配置文件httpd.conf

修改Apache24->conf下的httpd.conf

①修改ServerRoot的根路径:

ServerRoot "c:/Apache24"

改为

ServerRoot "d:/Apache24"

②修改ServerName你的主机名称:


#ServerName www.landui.com:80

改为

ServerName www.landui.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"

PHP环境搭建——httpd-2.4.23配置安装cmd命令输入services.msc

PHP环境搭建——httpd-2.4.23配置安装这时候httpd已经篇日志完成。

5.测试Apache

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

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

PHP环境搭建——httpd-2.4.23配置安装这是Apache服务器配置完成。




提交成功!非常感谢您的反馈,我们会继续努力做到更好!

这条文档是否有帮助解决问题?

非常抱歉未能帮助到您。为了给您提供更好的服务,我们很需要您进一步的反馈信息:

在文档使用中是否遇到以下问题: