#一、apache的搭建
####1、下载apache到本地
下载地址:https://www.apachelounge.com/download/


####2、配置apache的文件
用记事本打开config文件夹下的httpd.conf文件

找到Define SRVROOT 这个词把后面引号里的路径改成你apache文件的安装路径

####3、cmd注册apache服务
以管理员身份打开cmd,并cd到你的apache目录下的bin,之后输入 httpd -k install

####4、运行apache

变绿色就说明成功了,红色是失败

现在apache已经启动成功了(如果重新配置端口号了就在地址栏后面加上端口号)

##$\color{#FF0000}{失败原因}$
1.端口号被占用,可以看看是否IIS服务器没关闭,或者在httpd.conf更改端口号

2.重新注册apache服务
以管理员身份打开cmd,并cd到你的apache目录下的bin,先输入 httpd -k uninstall,之后输入 httpd -k install,然后再启动apache,查看是否成功。

#二、php的安装
下载地址:https://windows.php.net/download#php-7.3
1.文件夹里这个文件的名字改成php.ini

2.连接apache
打开apache下的这个文件


现在apache和php已经连接成功了