windows Apache 不会在 wamp 中启动

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22416403/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 11:27:40  来源:igfitidea点击:

Apache won't start in wamp

windowsapachewampwampserver

提问by Aoi

I have been googling for the past few hours but I simply can't get my apache on wamp to start. My skype isn't running, and the test port 80 shows it isn't being used by anything. Before this happened, I was trying to add a new vhost, but now I have reverted back all of the files where I made changes. Anyway to debug why apache won't start?

过去几个小时我一直在谷歌搜索,但我根本无法让我的 apache 在 wamp 上启动。我的 Skype 没有运行,测试端口 80 显示它没有被任何东西使用。在这发生之前,我试图添加一个新的虚拟主机,但现在我已经恢复了我所做更改的所有文件。无论如何要调试为什么apache不会启动?

Clicking on start/resume service for apache doesn't show any errors either.

单击 apache 的启动/恢复服务也不会显示任何错误。

Also just in case, I am running Win7 64bit

同样以防万一,我运行的是 Win7 64bit

回答by RiggsFolly

If you have an issue in the httpd.conf or any files included by it there are a couple of ways to find out what the problem is

如果您在 httpd.conf 或其中包含的任何文件中遇到问题,有几种方法可以找出问题所在

First look at your Windows Event Viewer. Click on the Windowslink in the menu on the left, and then submenu Applications. Look for messages from Apache with the red error icon.

首先看看你的Windows Event Viewer. 单击Windows左侧菜单中的链接,然后单击子菜单Applications。查找来自 Apache 的带有红色错误图标的消息。

Secondly, open a command window, then CD into \wamp\bin\apache\apache2.x.y\bin, replace x,y with your actual version. Now you can run this command to get Apache(httpd) to vaidate the httpd.conf file.

其次,打开一个命令窗口,然后CD进入\wamp\bin\apache\apache2.xy\bin,用你的实际版本替换x,y。现在您可以运行此命令来让 Apache(httpd) 验证 httpd.conf 文件。

httpd.exe -t

This should give errors with line numbers related to the http.conf file. It stops on the first error, so you will have to keep running it and fixing the error and then run it again until it gives the all OK message.

这应该会给出与 http.conf 文件相关的行号错误。它在第一个错误时停止,因此您必须继续运行它并修复错误,然后再次运行它,直到它给出所有 OK 消息。

回答by Yevgeniy Afanasyev

That is what I did and it helped me to find out what my Apache-PHP needed:

这就是我所做的,它帮助我找出我的 Apache-PHP 需要什么:

C:\Users\Admin>cd C:\wamp\bin\apache\apache2.4.9\bin

C:\wamp\bin\apache\apache2.4.9\bin>httpd -t
Syntax OK

C:\wamp\bin\apache\apache2.4.9\bin>httpd -k start
[Thu Apr 23 14:14:52.150189 2015] [mpm_winnt:error] [pid 3184:tid 112] 
(OS 2)The system cannot find the file specified.  : AH00436: 
No installed service named "Apache2.4".

C:\wamp\bin\apache\apache2.4.9\bin>

The most simple solution:

最简单的解决方法:

Uninstall and reinstall WAMP (do not even try to set it up on top of existing installation - it would not help)

卸载并重新安装 WAMP(甚至不要尝试在现有安装之上进行设置 - 它无济于事)

P.S.

聚苯乙烯

If you wonder how did I get to this situation, here is the answer: I was trying to install WAMP and it throws me an error in the middle of installation saying:

如果您想知道我是如何遇到这种情况的,答案如下:我正在尝试安装 WAMP,但在安装过程中出现错误提示:

httpd.exe - System Error

The program can't start because MSVCR110.dll is missing from your computer. 
Try reinstalling the program to fix this problem.

OK

I got and installed Microsoft Visual C++ 2012 Redistributable from here http://www.microsoft.com/en-us/download/details.aspx?id=30679#

我从这里安装了 Microsoft Visual C++ 2012 Redistributable http://www.microsoft.com/en-us/download/details.aspx?id=30679#

And it gave me the "dll" and the MYSQL started working, but not Apache. To make Apache to work I uninstalled and reinstalled WAMP.

它给了我“dll”并且 MYSQL 开始工作,但不是 Apache。为了让 Apache 工作,我卸载并重新安装了 WAMP。

回答by Mojtaba Rezaeian

Use apaches startup debug tool from command:

从命令使用 apaches 启动调试工具:

httpd.exe -e warn

httpd.exe -e warn

  1. press Win+R
  2. type cmdand press enter
  3. goto directory which contains your apache httpd.exefile. for example if your wamp is installed in e:\wamptype cd /d e:\wamp\bin\apache\ApacheX.X.X\binin cmd and press enter.
  4. type httpd.exe -e warn(or httpd.exe -e debugfor more details) to see error message about problem which is prohibiting apache to start.
  1. Win+R
  2. 输入cmd并按回车
  3. goto 包含您的 apachehttpd.exe文件的目录。例如,如果你的WAMP安装在e:\wamp类型cd /d e:\wamp\bin\apache\ApacheX.X.X\bin在cmd,然后按Enter键。
  4. 键入httpd.exe -e warn(或httpd.exe -e debug更多详细信息)以查看有关禁止 apache 启动的问题的错误消息。

回答by Chaudhry Waqas

Invalid Command '80HostnameLookups' , perhaps misspelled or defined by a module not included in the server configuration
I got this error when I debug the issue (wamp server was not going online) by the procedure defined by @RiggsFolly. Just comment the line 80HostnameLookups Offby changing it to #80HostnameLookups Off. This solution worked for me and apache starts running.
Note:80HostnameLookups Offcan be found on line 222of httpd.conffile located in C:\wamp\bin\apache\apache2.4.9\conf

Invalid Command '80HostnameLookups' , perhaps misspelled or defined by a module not included in the server configuration
当我通过@RiggsFolly 定义的程序调试问题(wamp 服务器没有上线)时出现此错误。只需将该行80HostnameLookups Off更改为#80HostnameLookups Off. 这个解决方案对我有用,apache 开始运行。
注意:80HostnameLookups Off可以在位于line 222httpd.conf文件中找到C:\wamp\bin\apache\apache2.4.9\conf

回答by saeid

phpmyadmin.conf opened with apacheconf.exe and contents chained so you must do the following:

phpmyadmin.conf 使用 apacheconf.exe 打开并链接了内容,因此您必须执行以下操作:

  1. copy contents of phpsysinfo.conf [C:\wamp\alias]
  2. paste into phpmyadmin.conf [C:\wamp\alias]
  3. change Alias /phpsysinfo "c:/wamp/apps/phpsysinfo3.1.12/"to Alias /phpmyadmin "c:/wamp/apps/phpmyadmin4.1.14/"
  4. change <Directory c:/wamp/apps/phpsysinfo3.1.12/ />to <Directory c:/wamp/apps/phpmyadmin4.1.14/ />
  1. 复制 phpsysinfo.conf 的内容 [C:\wamp\alias]
  2. 粘贴到 phpmyadmin.conf [C:\wamp\alias]
  3. 更改Alias /phpsysinfo "c:/wamp/apps/phpsysinfo3.1.12/"Alias /phpmyadmin "c:/wamp/apps/phpmyadmin4.1.14/"
  4. 更改<Directory c:/wamp/apps/phpsysinfo3.1.12/ /><Directory c:/wamp/apps/phpmyadmin4.1.14/ />

its worked for me.

它对我有用。

回答by H_alt

My solution was that 2 .dll files(msvcp110.dll, msvcr110.dll) were missing from the directory : C:\wamp\bin\apache\apache2.4.9\bin So I copied these 2 files to all these locations just in case and restarted wamp it worked C:\wamp C:\wamp\bin\apache\apache2.4.9\bin C:\wamp\bin\apache\apache2.4.9 C:\wamp\bin\mysql\mysql5.6.17 C:\wamp\bin\php\php5.5.12

我的解决方案是目录中缺少 2 个 .dll 文件(msvcp110.dll、msvcr110.dll):C:\wamp\bin\apache\apache2.4.9\bin 所以我将这 2 个文件复制到所有这些位置以防万一并重新启动 wamp 它工作 C:\wamp C:\wamp\bin\apache\apache2.4.9\bin C:\wamp\bin\apache\apache2.4.9 C:\wamp\bin\mysql\mysql5.6.17 C:\ wamp\bin\php\php5.5.12

I hope this helps someone out.

我希望这可以帮助某人。

回答by Mem Maina

Sometimes it is Skype or another application "Holding" on to port 80. Jusct close Skype

有时是 Skype 或其他应用程序“保持”到端口 80。请关闭 Skype

回答by ognjenkl

My solution on Windows 10 was just to stop IIS (Internet Information Services).

我在 Windows 10 上的解决方案只是停止 IIS(Internet 信息服务)。

回答by Joe Hunt

If Apache is installed as a Windows service, any errors will show up in the Windows System event log. To view the System event log, navigate to Windows Administrative Tools->Event Viewer and open the System log in the Windows Logs folder. Or, you can see the same errors by running httpd.exe at the command line. In my case, httpd.exe is located here: C:\Bitnami\wampstack-5.6.26-2\apache2\bin.

如果 Apache 作为 Windows 服务安装,则任何错误都会显示在 Windows 系统事件日志中。要查看系统事件日志,请导航到 Windows 管理工具->事件查看器并打开 Windows 日志文件夹中的系统日志。或者,您可以通过在命令行运行 httpd.exe 来查看相同的错误。就我而言,httpd.exe 位于:C:\Bitnami\wampstack-5.6.26-2\apache2\bin。

If there is a problem with starting Apache, most likely the problem can be fixed by editing the httpd.conf file located in the \apache2\conf folder. As already suggested, you can check the syntax of the httpd.conf file by running httpd.exe -t at the command line.

如果启动 Apache 时出现问题,很可能可以通过编辑位于 \apache2\conf 文件夹中的 httpd.conf 文件来解决问题。如前所述,您可以通过在命令行运行 httpd.exe -t 来检查 httpd.conf 文件的语法。

I found that the I had to

我发现我必须

Change SetEnv PATH "C:\Bitnami\wampstack-5.6.26-2\apache2\bin;${PATH}"in httpd.conf

SetEnv PATH "C:\Bitnami\wampstack-5.6.26-2\apache2\bin;${PATH}"httpd.conf 中的更改

to

SetEnv PATH "C:\Bitnami\wampstack-5.6.26-2\apache2\bin;%PATH%"

SetEnv PATH "C:\Bitnami\wampstack-5.6.26-2\apache2\bin;%PATH%"

回答by Graham Nyambura

I had the same problem. My port 80 was not in use.

我有同样的问题。我的 80 端口没有被使用。

After thorough research, all I did was to download Update for Universal C Runtime.

经过深入研究,我所做的就是下载更新通用 C 运行时

Once installed and my PC restarted, all was OK.

安装并重新启动我的电脑后,一切正常。