29

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?

Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
Madde
  • 471
  • 1
  • 7
  • 22
  • Usually skype uses the free ports 80 for incoming connections. Follow this tutorial on how to overcome this issue. Simply disable it in skype. Follow this tutorial for mor info http://www.feelzdroid.com/2015/12/install-php-server-local-machine.html – Naruto Dec 31 '15 at 17:26
  • I have the same issue, Just check my answer here; https://stackoverflow.com/a/46904133/621951 – Günay Gültekin Oct 24 '17 at 07:11

17 Answers17

47

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.

AfromanJ
  • 3,922
  • 3
  • 17
  • 33
  • I don't have skype and port 80 is still tied up. Although this worked I would like to get it back to port 80. Does anyone know what else could be using port 80? – Coomie May 06 '13 at 08:14
22

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.

shash7
  • 1,719
  • 1
  • 18
  • 20
  • 1
    how do i check which other services who use port 80? :] i have disabled skype from using port 80 :] – Madde Jan 09 '13 at 20:13
  • 2
    Open up cmd and type "netstat -aon" without the quotes. This will list out all the servies with their pid. Find out the service(the one using port 80) and list its pid. Then open task manager, go to the services tab and kill the process with the corresponding pid. – shash7 Jan 09 '13 at 20:17
  • i did what you said and killed two processes, but it still seems to be the same problem o: – Madde Jan 09 '13 at 20:48
  • Hmm. Now this seems to be a real bummer. I had such a problem some months ago. Btw, did you try to change the port of apache itself? You can figure out if the issue is with xampp or something else. – shash7 Jan 09 '13 at 20:52
  • i found one more by using netstat -o -n -a | findstr 0.0:80, it hase pid 4, but pid 4 doesen't excist in the services tab – Madde Jan 09 '13 at 20:53
  • how do you change the port of apache? =) – Madde Jan 09 '13 at 20:54
  • 1
    Must be a system process. Try disabling or uninstalling iis. Oh and edit the htaccess or the conf file to change the port. Its in there as far as I know. – shash7 Jan 09 '13 at 20:55
  • it worked! :D the iis was running so i stopped it :] thx, i really appreciate you took the time to help me :] – Madde Jan 09 '13 at 21:12
  • Skype was the culprit in my case. Tools > Options > Advanced > Connections Uncheck "Use ports 80 and 443 ..." – Dmytro Sukhovoy Feb 01 '16 at 20:57
  • 1
    after using "netstat -aon" to find the offending processes, you can kill them from cmd using "taskkill /pid " https://technet.microsoft.com/en-us/library/bb491009.aspx – Nick Kuznia Feb 04 '16 at 18:09
  • Skype was the culprit in my case – Jake Nov 30 '16 at 18:55
  • I just changed my apache port. open httpd.conf & it works for me. Easyphp is a good alternative. – Adnan Haider Jan 15 '19 at 21:42
13

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

enter image description here

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.

halfer
  • 19,824
  • 17
  • 99
  • 186
Muhammad Ashikuzzaman
  • 3,075
  • 6
  • 29
  • 53
9

Skype, try closing it and then running xampp, if it works then change the skype port to stop using port 80

7

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.

lanshark
  • 71
  • 3
6

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

pooria haddad
  • 795
  • 2
  • 8
  • 24
1

logout your account in skype.. then in xampp control panel click start from the line of Apache..

Joshua Fabillar
  • 506
  • 2
  • 9
  • 24
1

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. :)

Ahmad Asjad
  • 825
  • 1
  • 8
  • 29
0

In my case the problem was that the logs folder did not exist resp. the error.log file in this folder.

0

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.

Zoe Marmara
  • 1,142
  • 1
  • 10
  • 15
0

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

0

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

user2063329
  • 443
  • 2
  • 5
  • 15
0

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.

bhaskarc
  • 9,269
  • 10
  • 65
  • 86
0

In my case I simply had to run the control panel as administrator

user3047190
  • 319
  • 2
  • 7
0

just disable "world wide web publishing service" , it solve my problem.

0

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. :)

GanesH RahuL
  • 431
  • 5
  • 16
0

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.

Adrian Smith
  • 1,013
  • 1
  • 13
  • 21