Windows 环境下 Apache httpd-2.4.54 PHP7.0.10 安装配置
1.下载
-
PHP 下载
地址:https://windows.php.net/download -
123网盘合集 (推荐)
以上下载后均为压缩文件,解压到任意目录中。
2.配置
配置文件路径为: httpd-2.4.54-o111p-x64-vs17\Apache24\conf\httpd.conf
-
修改 Define SRVROOT “/Apache24” 中 /Apache24 为 绝对路径
-
修改 DocumentRoot “{SRVROOT}/htdocs”> 中 “${SRVROOT}/htdocs” 为你的网站根目录
-
修改 DirectoryIndex index.html 为 DirectoryIndex index.html index.php
-
文件末尾添加
1 | # php7 配置 |
3.添加测试文件
编辑 D:\phpEnv\www\index.php
1 | phpinfo(); |
4.运行
终端运行 ./Apache24/bin/httpd.exe , 浏览器访问 localhost:80
5.添加自启服务
管理员权限终端执行 ./Apache24/bin/httpd.exe -k install -n “Apache24”