1、下载Apache服务器
httpd-2.4.59-240404-win64-VS17
2、安装
直接将httpd-2.4.59-240404-win64-VS17解压缩到C:盘跟目录下
3、配置
在C:\Apache24\conf路径下找到httpd.conf打开
修改如下几行
#修改下面两行
# "${SRVROOT}/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "${SRVROOT}/cgi-bin">
#AllowOverride None
#Options None
AllowOverride All
Options +ExecCGI
Require all granted
</Directory>
#取消注释下面一行
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
AddHandler cgi-script .cgi
6、开启httpd服务
运行 C:\Apache24\bin\httpd.exe
退出Ctrl+C
5、测试
在浏览器下访问测试cgi