简体   繁体   English

Apache不会在xampp中运行

[英]Apache won't run in xampp

I have just installed XAMPP and everything works fine except that I can't get apache to run. 我刚刚安装了XAMPP,一切正常,但我无法运行apache。 It seems that port 80 is the problem, I have disabled Skype to use port 80 but it doesn't seem to fix it. 似乎端口80是问题,我已禁用Skype使用端口80,但它似乎没有解决它。 I read somewhere that the SSL port can be the problem and should be changed. 我读到某个地方SSL端口可能是问题,应该更改。 But I cant figure out were the port is or how to change it. 但我无法弄清楚端口是或如何改变它。

"Check the "/xampp/apache/logs/error.log" file"

I have tried to check this file but inside "logs" there isn't anything. 我试图检查这个文件,但在“日志”里面没有任何东西。 From apache I can go to error but there is not any recently changed documents. 从apache我可以去错误,但没有最近更改的文件。

The error: 错误:

20:34:24  [Apache]  Problem detected!
20:34:24  [Apache]  Port 80 in use by "system"!
20:34:24  [Apache]  Apache WILL NOT start without the configured ports free!
20:34:24  [Apache]  You need to uninstall/disable/reconfigure the blocking application
20:34:24  [Apache]  or reconfigure Apache to listen on a different port

20:40:50  [Apache]  Attempting to start Apache app...
20:40:50  [Apache]  Status change detected: running
20:40:51  [Apache]  Status change detected: stopped
20:40:51  [Apache]  Error: Apache shutdown unexpectedly.
20:40:51  [Apache]  This may be due to a blocked port, missing dependencies, 
20:40:51  [Apache]  improper privileges, a crash, or a shutdown by another method.
20:40:51  [Apache]  Check the "/xampp/apache/logs/error.log" file
20:40:51  [Apache]  and the Windows Event Viewer for more clues

How to I fix these errors? 如何修复这些错误?

If you just want to make Apache run an don't mind which port it is running on, do the following: 如果您只想让Apache运行,请不要介意它运行的端口,请执行以下操作:

In the XAMPP Control Panel, click on the Apache - 'Config' button which is located next to the 'Logs' button. 在XAMPP控制面板中,单击Apache - “配置”按钮,该按钮位于“日志”按钮旁边。

Select 'Apache (httpd.conf)' from the drop down. 从下拉列表中选择“Apache(httpd.conf)”。 (notepad should open) (记事本应该打开)

Do Ctrl + F to find '80'. 按Ctrl + F查找“80”。 Click 'find next' three times and change line Listen 80 to Listen 8080 单击“查找下一个”三次并将“ Listen 80更改为“ Listen 8080

Click 'find next' again a couple times until you see line ServerName localhost:80 change this to ServerName localhost:8080 再次单击“查找下一个”,直到看到ServerName localhost:80行将其更改为ServerName localhost:8080

Do Ctrl + S to save and then exit notepad. 按Ctrl + S保存然后退出记事本。

Start up Apache again in the XAMPP Control Panel, Apache should successfully run. 在XAMPP控制面板中再次启动Apache,Apache应该成功运行。

Use http://localhost:8080/ in your browser address bar to check everything is working. 在浏览器地址栏中使用http://localhost:8080/来检查一切正常。

EDIT 编辑

Also you may have problems running XAMPP while running IIS. 此外,您在运行IIS时可能会遇到运行XAMPP的问题。 If you are running IIS it might be worth stopping the service then starting XAMPP. 如果您正在运行IIS,则可能需要停止服务然后启动XAMPP。

Find out which other service uses port 80. 找出哪个其他服务使用端口80。

I have heard skype uses port 80. Check it there isn't another server or database running in the background on port 80. 我听说skype使用端口80.检查端口80上没有其他服务器或数据库在后台运行。

Two good alternatives to xampp are wamp and easyphp . xampp的两个很好的替代品是wampeasyphp Out of that, wamp is the most user friendly and it also has a built in tool for checking if port 80 is in use and which service is currently using it. 除此之外,wamp是最友好的用户,它还有一个内置工具,用于检查端口80是否正在使用以及当前正在使用哪个服务。

Or disable iis. 或者禁用iis。 It has been known to use port 80 by default. 众所周知,默认情况下使用端口80。

There are 2 ways to solving this problem. 有两种方法可以解决这个问题。

  1. If you want to run Apache in another port then:Replace in xampp/apache/conf/httpd.conf "ServerName localhost:80" by "ServerName localhost:81" At line 184. After that even it may not work.Then replace 如果你想在另一个端口运行Apache,那么:在xampp / apache / conf / httpd.conf中替换“ServerName localhost:80”by“ServerName localhost:81”在第184行。之后,即使它可能无法工作。然后更换
#Listen 0.0.0.0:80
#Listen [::]:80
Listen 80 

by 通过

#Listen 0.0.0.0:81
#Listen [::]:81
Listen 81

at line 45 在第45行

  1. If you want to use port 80. Then follow this. 如果要使用端口80,请执行以下操作。 In Windows 8 “World Wide Publishing Service is using this port and stopping this service will free the port 80 and you can connect Apache using this port. 在Windows 8“World Wide Publishing Service正在使用此端口并停止此服务将释放端口80,您可以使用此端口连接Apache。 To stop the service go to the “Task manager –> Services tab”, right click the “World Wide Publishing Service” and stop. 要停止服务,请转到“任务管理器 - >服务选项卡”,右键单击“全球发布服务”并停止。 If you don't find there then Then go to "Run > services.msc" and again find there and right click the “World Wide Publishing Service” and stop. 如果你没有找到那么然后去“运行> services.msc”并再次找到并右键单击“全球发布服务”并停止。

If you didn't find “World Wide Publishing Service” there then go to "Run>>resmon.exe>> Network Tab>>Listening Ports" and see which process is using port 80 如果您没有找到“全球发布服务”,那么请转到“运行>> resmon.exe >>网络选项卡>>侦听端口”并查看哪个进程正在使用端口80

在此输入图像描述

And from "Overview>>CPU" just Right click on that process and click "End Process Tree". 从“概述>> CPU”只需右键单击该过程,然后单击“结束进程树”。 If that process is system that might be a critical issue. 如果该过程是可能是关键问题的系统。

Skype,尝试关闭它然后运行xampp,如果它工作,然后更改Skype端口停止使用端口80

Take a look at this site: 看看这个网站:

http://www.lukebrowning.com/blog/nt-kernel-system-using-port-80/ http://www.lukebrowning.com/blog/nt-kernel-system-using-port-80/

In my case, it was the SQL Server Reporting Service, but others have seen IIS or the Web Deployment Agent Service. 就我而言,它是SQL Server报告服务,但其他人已经看过IIS或Web部署代理服务。

Open a cmd window and run services.msc, find the service, and stop it. 打开cmd窗口并运行services.msc,找到该服务并停止它。 Then try to start Apache. 然后尝试启动Apache。 If it works, disable the other service. 如果可行,请禁用其他服务。

Note that this problem usually occure for two reasons: 请注意,此问题通常会出现两个原因:

1-Port 80 is busy. 1端口80正忙。

2-Port 443 is busy. 2端口443正忙。

For number one as the others said, you can kill Skype and SQL Serever Reporter from 对于其他人说的第一名,你可以杀死Skype和SQL Serever Reporter

Windows Task Manager>"Services" Tab>"Services..." Button. Windows任务管理器>“服务”选项卡>“服务...”按钮。

But if it dosen't worked, it's probably because of port 443, so try this one: 但如果它不起作用,可能是因为端口443,所以试试这个:

If you use VMware, go to 如果您使用VMware,请转到

Windows Task Manager>"Services" Tab>"Services..." Button, and find "VMware Workstation Server" service, double click on it and press "Stop" button. Windows任务管理器>“服务”选项卡>“服务...”按钮,找到“VMware Workstation Server”服务,双击它并按“停止”按钮。

There is no need to stop other VMware's services. 没有必要停止其他VMware的服务。

Then again try to run Apache 然后再次尝试运行Apache

在skype中注销你的帐户..然后在xampp控制面板中单击从Apache行开始..

In my case, it was something else. 在我的情况下,它是另一回事。 One day earlier I tried to install wordpress using bitnam of xampp, but I was not successfull. 前一天我尝试使用xampp的bitnam安装wordpress,但我没有成功。 When I saw the error log, there was an error : 当我看到错误日志时,出现错误:

httpd.exe: Syntax error on line 560 of C:/xampp/apache/conf/httpd.conf: Could not open configuration file C:/xampp/apps/wordpress/conf/httpd-prefix.conf: The system cannot find the path specified.

I opened the httpd.conf and found this line: 我打开了httpd.conf并找到了这一行:

Include "C:/xampp/apps/wordpress/conf/httpd-prefix.conf"

I just commented it with #, 我只是用#评论它,

Now it's running fine. 现在它运行正常。 :) :)

In my case the problem was that the logs folder did not exist resp. 在我的情况下,问题是日志文件夹不存在resp。 the error.log file in this folder. 此文件夹中的error.log文件。

Like Ianshark points out, a common reason for this error in Windows 7 is the Web Deployment Agent service . 就像Ianshark指出的那样,Windows 7中出现此错误的常见原因是Web部署代理服务

The Web Deploy Tool enables administrators to use IIS Manager to deploy ASP.NET and PHP applications to an IIS server. Web Deploy Tool使管理员能够使用IIS管理器将ASP.NET和PHP应用程序部署到IIS服务器。

You can disable it from XAMPP Control Panel by clicking the "Services" button. 您可以通过单击“服务”按钮从XAMPP控制面板禁用它。 If you have changed the port in the Apache config file, change it back to 80. Then uninstall Microsoft Web Deploy , if you prefer a more permanent solution. 如果您更改了Apache配置文件中的端口,请将其更改回80.如果您更喜欢更永久的解决方案,请卸载Microsoft Web Deploy

Do you have Bitnami installed? 你有Bitnami安装吗? If so it is most likely one of those installations check by opening command prompt as admin or terminal in linux, enter this... 如果是这样,很可能其中一个安装通过在linux中打开命令提示符作为管理员或终端进行检查,请输入此...

netstat -b

This will give an application name to those processes and ports in use. 这将为正在使用的进程和端口提供应用程序名称。 Look for :80 or :443 寻找:80或:443

I had the same kind of problems. 我遇到了同样的问题。 I finally made it to work. 我终于开始工作了。

I successfully changed the apache ports to listen to ports not used by other programs Port 443 is used by SSL and Skype 我成功地更改了apache端口以侦听其他程序未使用的端口.SSL 443由SSL和Skype使用

I believe that the XAMPP Control Panel has a bug and I have screen shots in my posts to. 我相信XAMPP控制面板有一个错误,我的帖子中有屏幕截图。 I do not have enough credibility on this web site to upload pictures. 我在这个网站上没有足够的可信度来上传图片。

I have the whole thing written down with screen shots in the following blog posts: 我在以下博客文章中用屏幕截图写下了整个内容:

http://hodentek.blogspot.com/2014/02/one-way-to-handle-port-80-in-use-by.html http://hodentekhelp.blogspot.com/2014/02/on-installing-apache-on-windows-7-64bit.html http://hodentekhelp.blogspot.com/2014/02/do-you-want-to-change-ports-that-skype.html http://hodentek.blogspot.com/2014/02/one-way-to-handle-port-80-in-use-by.html http://hodentekhelp.blogspot.com/2014/02/on-installing -apache-on-windows-7-64bit.html http://hodentekhelp.blogspot.com/2014/02/do-you-want-to-change-ports-that-skype.html

None of the above worked for me. 以上都不适合我。 This is what finally worked for me: 这最终对我有用:

1) Start Services (Type services in your start > search)
2) Look for Apache services.It was disabled in my case. Enabling it worked for me.

Some people have also reported duplicate listing of Apache services which has prevented it from starting. 有些人还报告了Apache服务的重复列表,这阻止了它的启动。 If that is the case, delete/disable one of the Apache services which corresponds to the wrong path. 如果是这种情况,请删除/禁用与错误路径对应的Apache服务之一。

A restart of XAMPP might be required. 可能需要重新启动XAMPP。

在我的情况下,我只需要以管理员身份运行控制面板

只是禁用“万维网发布服务”,它解决了我的问题。

In my case, it was something else. 在我的情况下,它是另一回事。 One day earlier I tried to install Magento using bitnami of xampp. 前一天我尝试使用xampp的bitnami安装Magento。 And I deleted That Module 我删除了那个模块

I opened the httpd.conf and found this line: 我打开了httpd.conf并找到了这一行:

Include "C:/xampp/apps/magento/conf/httpd-prefix.conf"

I just commented it with #, 我只是用#评论它,

Now it's running fine. 现在它运行正常。 :) :)

Try stopping Apache and MySql and starting them again in the following order. 尝试停止Apache和MySql并按以下顺序重新启动它们。

  1. Apache 阿帕奇
  2. MySql MySQL的
  3. Etc... 等等...

Wait for both services to stop properly before restarting. 等待两个服务在重新启动之前正确停止。 Turning them on and off too quickly gives the same problem. 过快地打开和关闭它们会产生同样的问题。

Inspired by lansharks answer . 灵感来自lansharks的答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM