Apache服务器安装过程及问题的解决(for windows system32bit)

时间:2023-03-08 17:39:50
Apache服务器安装过程及问题的解决(for windows system32bit)

  在使用Hbuilder设计网站时,在制作本站搜索时,用到了Php文件,而Hbuilder的内置web服务器不支持php的解析,

所以需要安装配置外部服务器,有多个选择,我安装的apache服务器,并遇到了几个问题,最后得以解决,作为记录。

1.下载

登陆apache官方下载网页:http://httpd.apache.org/download.cgi

Apache服务器安装过程及问题的解决(for windows system32bit)

随意点击以上所示链接,

Apache服务器安装过程及问题的解决(for windows system32bit)

点击“Files for Microsoft”进入

Apache服务器安装过程及问题的解决(for windows system32bit)

点击第一个就可以,

Apache服务器安装过程及问题的解决(for windows system32bit)

点击三色条形可以进行下载

2.安装

打开命令行窗口,进入bin文件夹,输入命令:

httpd -k install

则可以安装,但有些报错的情况:

Apache服务器安装过程及问题的解决(for windows system32bit)

这是因为在Windows下运行最新版的Apache和php7都需要Visual C++Redistributable 2015,这个组件是运行Visual Studio 2015所建立的C++应用的必要组件,

安装则可解决环境问题,那么去微软官网下载安装程序,安装一遍重启电脑。https://www.microsoft.com/en-US/download/details.aspx?id=48145

不过又有问题了,

Apache服务器安装过程及问题的解决(for windows system32bit)

这是权限的问题,可以这样解决:

找到cmd.exe程序,以管理员身份运行,进入命令行窗口,再次输入安装代码,

Apache服务器安装过程及问题的解决(for windows system32bit)

出现了一个问题,怎么解决呢?

找到下面目录中文件:/conf/httpd.conf,把ServerName非注释行的#去掉即可。