首页 » PHP教程 » httpd运行php技巧_PHP情形搭建httpd2423设备安装

httpd运行php技巧_PHP情形搭建httpd2423设备安装

duote123 2024-12-13 0

扫一扫用手机浏览

文章目录 [+]

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

2.解压

httpd运行php技巧_PHP情形搭建httpd2423设备安装

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

httpd运行php技巧_PHP情形搭建httpd2423设备安装
(图片来自网络侵删)

3.修正配置文件httpd.conf

修正Apache24->conf下的httpd.conf

①修正ServerRoot的根路径:

ServerRoot \"大众c:/Apache24\"大众

改为

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反射类注释技巧_php反射机制用法详解

面向工具编程中工具被授予了自省的能力,而这个自省的过程便是反射。反射,直不雅观理解便是根据到达地找到出发地和来源。比如,一个光秃秃...

PHP教程 2024-12-15 阅读0 评论0