安装Apache ,注意必须下载对应操作系统和 VC版本
安装php 注意选择 thread safe 和机器环境
配置环境变量(e.g.)
D:\software\Apache24\bin
D:\software\php-7.3.x
D:\software\php-7.3.x\ext
修改/config/httpd.conf
文件中 ServerRoot "c:/Apache24" 为实际存放路劲,注:路径最后没有“\”
首次,Apache装入windows后台服务,通过cmd中 services.msc
把Apache24改为自启动(省去每次开机都要 start一遍)
httpd.exe -k install
启动Apache,使用start,后续修改过php文件,用restart即可
httpd.exe -k [restart|start]
通过浏览器 localhost:80 判断是否运行成功
备注:若80端口被占用,使用netstat -aon|findstr "80"
查看占用情况,关闭相关软件,或者打开Apache目录下 /config/httpd.conf
找到 Listen 80 一行,修改监听端口在restart
移除Apache服务
httpd.exe -k stop
httpd.exe -k uninstall