简体   繁体   中英

Apache won't run in xampp

I have just installed XAMPP and everything works fine except that I can't get apache to run. It seems that port 80 is the problem, I have disabled Skype to use port 80 but it doesn't seem to fix it. I read somewhere that the SSL port can be the problem and should be changed. 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.

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:

In the XAMPP Control Panel, click on the Apache - 'Config' button which is located next to the 'Logs' button.

Select 'Apache (httpd.conf)' from the drop down. (notepad should open)

Do Ctrl + F to find '80'. Click 'find next' three times and change line Listen 80 to Listen 8080

Click 'find next' again a couple times until you see line ServerName localhost:80 change this to ServerName localhost:8080

Do Ctrl + S to save and then exit notepad.

Start up Apache again in the XAMPP Control Panel, Apache should successfully run.

Use http://localhost:8080/ in your browser address bar to check everything is working.

EDIT

Also you may have problems running XAMPP while running IIS. If you are running IIS it might be worth stopping the service then starting XAMPP.

Find out which other service uses port 80.

I have heard skype uses port 80. Check it there isn't another server or database running in the background on port 80.

Two good alternatives to xampp are wamp and easyphp . 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.

Or disable iis. It has been known to use port 80 by default.

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
#Listen 0.0.0.0:80
#Listen [::]:80
Listen 80 

by

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

at line 45

  1. If you want to use port 80. Then follow this. 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. 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.

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

在此输入图像描述

And from "Overview>>CPU" just Right click on that process and click "End Process Tree". 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/

In my case, it was the SQL Server Reporting Service, but others have seen IIS or the Web Deployment Agent Service.

Open a cmd window and run services.msc, find the service, and stop it. Then try to start Apache. If it works, disable the other service.

Note that this problem usually occure for two reasons:

1-Port 80 is busy.

2-Port 443 is busy.

For number one as the others said, you can kill Skype and SQL Serever Reporter from

Windows Task Manager>"Services" Tab>"Services..." Button.

But if it dosen't worked, it's probably because of port 443, so try this one:

If you use VMware, go to

Windows Task Manager>"Services" Tab>"Services..." Button, and find "VMware Workstation Server" service, double click on it and press "Stop" button.

There is no need to stop other VMware's services.

Then again try to run 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. 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:

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. the error.log file in this folder.

Like Ianshark points out, a common reason for this error in Windows 7 is the Web Deployment Agent service .

The Web Deploy Tool enables administrators to use IIS Manager to deploy ASP.NET and PHP applications to an IIS server.

You can disable it from XAMPP Control Panel by clicking the "Services" button. 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.

Do you have Bitnami installed? If so it is most likely one of those installations check by opening command prompt as admin or terminal in linux, enter this...

netstat -b

This will give an application name to those processes and ports in use. Look for :80 or :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

I believe that the XAMPP Control Panel has a bug and I have screen shots in my posts to. 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

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. If that is the case, delete/disable one of the Apache services which corresponds to the wrong path.

A restart of XAMPP might be required.

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

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

In my case, it was something else. One day earlier I tried to install Magento using bitnami of xampp. And I deleted That Module

I opened the httpd.conf and found this line:

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.

  1. Apache
  2. 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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