Xampp Apache服务器将无法启动-“错误:Apache意外关闭." [英] Xampp Apache server won't start - "Error: Apache shutdown unexpectedly."

查看:265
本文介绍了Xampp Apache服务器将无法启动-“错误:Apache意外关闭."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在互联网上搜索了很多答案,但都没有成功.几个月前,我下载了xampp,直到最近,一切都运转良好.当我无法访问localhost时,我注意到了问题,所以我进入了xammp控制面板,发现apache已关闭.每次收到此消息时,单击立即开始"时-

I've searched far and wide on the internet for answers but with no success. I downloaded xampp a couple of months ago and everything has worked fine until recently. I noticed the problem when I was unable to access localhost so I went onto the xammp control panel and saw that apache was turned off. When I click start now every time I get this message -

13:41:55  [Apache]  Error: Apache shutdown unexpectedly.
13:41:55  [Apache]  This may be due to a blocked port, missing dependencies, 
13:41:55  [Apache]  improper privileges, a crash, or a shutdown by another method.
13:41:55  [Apache]  Press the Logs button to view error logs and check
13:41:55  [Apache]  the Windows Event Viewer for more clues
13:41:55  [Apache]  If you need more help, copy and post this
13:41:55  [Apache]  entire log window on the forums

对此的常见答案似乎是将httpd.conf文件中的端口从80更改为8080,然后将httpd-ssl.conf文件中的端口从443更改为4433.我已经做到了,但仍然无法正常工作.当我检查apache错误日志时,它说-

A common answer to this seems to be to change the port from 80 to 8080 in the httpd.conf file and then changing it from 443 to 4433 in the httpd-ssl.conf file. I have already done this and still not working. When I check the apache error logs it says -

AH00020: Configuration Failed, exiting

也许值得一提的是,几天前我在本地服务器上安装了Wordpress,也许与它有关?我已经尝试了一切,从重新启动计算机到运行完整的病毒扫描,似乎没有任何效果.

It might be worth mentioning that I installed Wordpress on my local server a few days ago and maybe that might have something to do with it? I have tried everything from re-starting my computer to running a full virus scan and nothing seems to work.

我正在使用Windows 10,Apache 2.4和PHP 7.

I am using Windows 10, Apache version 2.4 and PHP 7.

我现在也尝试在Shell中键入命令"httpd -t",它返回语法正确".这也是来自Apache错误日志的示例-

I've now also tried typing in the command "httpd -t" in Shell and it returns "syntax OK". Also here is a sample from the apache error log -

PHP Warning:  'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0
[Tue Jun 09 04:15:03.462661 2020] [:emerg] [pid 4160:tid 548] AH00020: Configuration Failed, exiting
[Tue Jun 09 12:54:30.209908 2020] [core:warn] [pid 4000:tid 684] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
PHP Warning:  'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0
[Tue Jun 09 12:54:30.239019 2020] [:emerg] [pid 4000:tid 684] AH00020: Configuration Failed, exiting

感谢您抽出宝贵的时间阅读本文,如果有人有任何想法,将不胜感激.

Thanks for taking the time to read this and if anyone has any ideas it would be much appreciated.

推荐答案

好,我设法解决了这个问题.

Ok I've managed to solve the proplem.

对于遇到相同问题(即使端口80可用,apache也无法启动)的任何人,此信息可能很有用.

For anyone who is having the same problem (apache won't start even if port 80 is available) this info could be useful.

当我查看apache错误日志时,有很多错误,但是引起该问题的特定错误是-

When I looked through the apache error logs there were a number of errors but the particular error causing the problem was -

PHP Warning:  'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0

如果其他人遇到此错误,则可以通过安装"Visual Studio 2015、2017和2019"运行时来解决(x64:vc_redist.x64.exe).这是您可以下载的链接.

If anyone else gets this error it can be solved by installing the "Visual Studio 2015, 2017 and 2019" runtime (x64: vc_redist.x64.exe). Here's the link to where you can download it.

https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

下载完成后,进入xampp文件夹,右键单击xampp-control.exe,单击以管理员身份运行",这样您就可以毫无问题地启动apache了.

After the download is finished, go into xampp folder and right click on xampp-control.exe, click "run as administrator" then you should be able to start apache with no problems.

希望这会帮助在与我相同的情况下结束比赛的任何人.

Hope this will help anyone who winds up in the same situation as I did.

这篇关于Xampp Apache服务器将无法启动-“错误:Apache意外关闭."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆