PC 上的 Apache 不以未找到 ServerRoot 开头

Posted

技术标签:

【中文标题】PC 上的 Apache 不以未找到 ServerRoot 开头【英文标题】:Apache on PC doesn't start with a ServerRoot not found 【发布时间】:2016-02-05 09:27:35 【问题描述】:

我已经格式化了我的电脑(使用 windows 10 pro 64 位)并重新安装了 apache 2.4.17 和 php 5.6.15。但是,当我给出“httpd -k install”时,从行命令我收到错误“httpd:C:/Server/Apache/conf/httpd.conf 第 37 行的语法错误:ServerRoot 必须是有效目录” 在 httpd.conf 的第 37 行我放了

ServerRoot "C:/Server/Apache"

那么为什么 httpd.conf 找不到这个目录????

【问题讨论】:

【参考方案1】:

显示此消息的原因可能不同。全部验证:

您是否以管理员身份运行此程序。 尝试为此目录提供 -d 选项

【讨论】:

【参考方案2】:

要修复此错误,请在 C:\local\apache\conf\httpd.conf 中打开并编辑以下行:

#ServerRoot "c:/Apache24" # original setting
ServerRoot "c:/local/apache" #according to your apache destination

【讨论】:

以上是关于PC 上的 Apache 不以未找到 ServerRoot 开头的主要内容,如果未能解决你的问题,请参考以下文章