可以通过命令行启动Apache,但不能通过Wamp Server启动

时间:2018-09-26 23:04:55

标签: apache wampserver

我在Windows 10上运行了wampserver 3.1.4。它可以启动php&MySql,但不能启动Apache。 我可以从命令行运行httpd.exe,它开始没有问题。

EventViewer告诉我,DocumentRoot行上的vhosts文件中有一个语法错误,但是我检查了路径,并且一切都正确,并且从CLI启动OK。

似乎wampapache64的某个地方配置错误。

这是我的httpd-vhosts.conf文件

语法错误发生在第二个块的'DocumentRoot'行中。 如果我删除第二个块,它工作正常。 文件夹的路径正确

# Virtual Hosts
#
<VirtualHost *:80>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName local.shiftlegal.co.nz
    DocumentRoot "c:/projects/true/shift/shiftlegal.co.nz"
    <Directory  "c:/projects/true/shift/shiftlegal.co.nz/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>

我还应该注意,这种确切的配置已经在几天前生效。

每次尝试运行wamp时,我都会在Windows EventViewer中收到2条错误消息:

The Apache service named  reported the following error:
>>> AH00526: Syntax error on line 16 of C:/wamp64/bin/apache/apache2.4.35/conf/extra/httpd-vhosts.conf:     .

The Apache service named  reported the following error:
>>> DocumentRoot must be a directory     .

1 个答案:

答案 0 :(得分:0)

好吧。

我不确定发生了什么,但事实证明与wampserver无关。

看来我的项目文件夹已损坏。我创建了一个新文件夹并添加了一个项目,并且该文件夹可以正常工作。

感谢@RiggsFolly的所有帮助。