Xampp reports "Apache shutdown unexpectedly" error - apache

Xampp we ran a while Apache crashes, but do not know the cause.
8:16:54 AM [Apache] Status change detected: stopped
8:16:54 AM [Apache] Error: Apache shutdown unexpectedly.
8:16:54 AM [Apache] This may be due to a blocked port, missing dependencies,
8:16:54 AM [Apache] improper privileges, a crash, or a shutdown by another method.
8:16:54 AM [Apache] Press the Logs button to view error logs and check
8:16:54 AM [Apache] the Windows Event Viewer for more clues
8:16:54 AM [Apache] If you need more help, copy and post this
8:16:54 AM [Apache] entire log window on the forums

I had the same issue when I tried to get Apache to start in XAMPP. Most answers I came across had to do with going into "Services" and making the "World Wide Web Publishing Service" Stop. However, when I looked for it in "Services" (Windows 10) it wasn't there, so I tried another route and it worked. Here are the steps I took:
From the XAMPP Control Panel, click "config" for Apache, and access (httpd.conf)
Locate the following:
"#Listen 12.34.56.78:80 #Listen 80" (the "#Listen 80" will be on a second line, for some reason Stack Overflow distorts the text when I duplicate it here.
Change the second line to "Listen 8080"
Drop down to "ServerName localhost: 80" & change it to "ServerName localhost: 8080"
Save and Close the file
From the XAMPP Control Panel, click "config" for Apache, and access (httpd-ssl.conf)
Locate the following: "Listen 443" & change it to "Listen 4433"
Drop down to "," change it to ""
Save and Close the file.
Now, when you click for Apache to start, it should turn green and all will be well. If this doesn't help try the popular fix of locating the "World Wide Web Publishing Service" and right click to "Stop" it - it didn't work for me, but it might work for you. I really hope this helps someone out there.

try this on PowerShell
netstat -na | Select-String "80"
this will help out identifying if any service is using port 80 or not. to identify what using it try following on
Get-Process -Id (Get-NetTCPConnection -LocalPort 80).OwningProcess
this will bring up the Id of process. Most of the case on newly installed windows boxes, it might be "World Wide Web" service. for some reason I am not able to spot it in services console. Anyway following will help to stop it.
sc stop w3svc
If it is there it would be stopped and you can verify buy running above command again.
EDIT:
you may have BatchCache service running which requests http.sys service to register port 80 when running in distributed mode. there is a way to change the port for this but I haven't tried instead i prefer to stop. Probably stopping through services will not work so using following commnd on powershell may help
Disable-BC
If you like to know other command of BranchCache use following command
Get-Command -Module BranchCache
There are some other articles proposing to stop http.sys service which may or may not be desired as per your circumstances see what each of the depended services does

Maybe you set virtual host in another drive (such as external harddrive) and you disconnect it.
Connect it again and change DoucumentRoot and Directtory to the right location.
file httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "E:/somefolder"
ServerName myweb.local
ServerAlias www.myweb.local
<Directory "E:/somefolder">
AllowOverride All
Require all Granted
Options All Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

This error occurs because your Xampp default port 80 is already used by another server like Oracle or Tomcat web server,
If you want step by step support please Click Here

Related

Apache : Port 80 in use by ""c:\xampp\apache\bin\httpd.exe" -k runservice" with PID 1492

Please someone can help me to solve this problem step-by-step.
11:23:28 AM [Apache] You need to uninstall/disable/reconfigure the blocking application
11:23:28 AM [Apache] or reconfigure Apache and the Control Panel to listen on a different port
11:23:28 AM [Apache] Problem detected!
This happens sometimes, give this a try:
Click "Config" button
Select "httpd.conf" from the dropdown.
On the line where it says "Listen 80" change that to "Listen8080"
Save the file.
Close the file.
Open browser and type " localhost:8080 "
Smile because it worked.
You have installed Apache already before installing XAMPP. The error is because Apache is configured to work with a particular port.
The best way to solve this would be to stop the old Apache service from running.
Go to control panel->administrative tools->services and look for
Apache.
Under the Status tab it says Running.
Click on it and set it to stop.
Now restart your Xampp and start Apache.
It looks like there is another apache process running which has the access to the port.
Have you tried using task manager to stop this process?
Also, you can look in control panel->administrative tools->services
You could have installed apache as a windows service which is started by default on boot up.

Xampp - Apache Shuts Down Unexpectedly, Empty Log File And No Events

I have XAMPP installed on my machine. I am trying to run Apache from the XAMPP Control Panel.
I start the XAMPP Control Panel by right-clicking the shortcut and selecting "Run as administrator" (I am logged in on an account with Administrator privileges). The Control Panel starts up and everything appears to be in order (no error messages/warnings).
When I click the Start button next to Apache I get the following error message:
2:22:44 PM [Apache] Attempting to start Apache app...
2:22:45 PM [Apache] Status change detected: running
2:22:45 PM [Apache] Status change detected: stopped
2:22:45 PM [Apache] Error: Apache shutdown unexpectedly.
2:22:45 PM [Apache] This may be due to a blocked port, missing dependencies,
2:22:45 PM [Apache] improper privileges, a crash, or a shutdown by another method.
2:22:45 PM [Apache] Check the "/xampp/apache/logs/error.log" file
2:22:45 PM [Apache] and the Windows Event Viewer for more clues
Note that it's telling me Apache has shutdown unexpectedly and to check the error.log file and the Windows Event Viewer.
I checked the error.log file but it's empty:
I also checked for any events using Windows Event Viewer but the event viewer shows no events (under Application):
I have checked for programs that might be blocking ports, etc. (like Skype, Visual SVN Server) and closed any programs that might be causing the issue.
Is there anything else I can do to find out what might be going on?
Thank you.
UPDATE
I figured out the problem by trying to run apache from a DOS command prompt. Running from the command prompt gave me the specific errors and the location in the httpd.conf file where those errors were. It turns out that my ServerRoot and DocumentRoot values were incorrect (pointing to wrong directories). I changed them to point to the correct directories and now I can start apache from the Control Panel.
Curious, why didn't I see the error messages about ServerRoot and DocumentRoot when launching from the Control Panel?
Just wanted to mention that I also used the command prompt technique.
MY PROBLEM: I had restarted Apache but was unable to get the program to start again.
Solution attempt 1: This did not work.
I had no programs such as SKYPE hogging the ports, but I tried to adjust my port settings anyway.
Solution attempt 2: This did not work.
Another solution I had read was to also allow public access in windows firewall or disable firewall. I attempted this.
Solution attempt 3: This did work
Finally I stumbled upon this post. I opened gitbash (although default windows command prompt would work fine).
I typed "cd c:/xampp/apache/bin"
I then typed "httpd"
This presented me with a syntax error and pointed me to a specific line in my "httpd-vhosts" file. I figured out what was wrong with that line, in my case a missing "#". Saved the file and then typed "httpd" again. This time the apache server started.
Hope this helps some people!
In my case I had to install XAMPP on server running IIS and I have to have IIS running. So, in XAMPP, if you change port via main Config button > Service and Port Settings it will not do anything. Instead, simply click on Config Button for Apache and then Apache (httpd.conf). Change "listen 80" to "listen 8080" (no quotes) or whatever port number you wish - just make sure it's not currently used.
I hope it helps someone.
This issue can happen because of three reasons
1. ServerRoot,DocumentRoot path not correct
2. Other applications already using ports in httpd.config or httpd-ssl.config. User NetStat button on XAMP control panel to check this conflict
3. Port set on XAMP control panel for httpd/httpd-ssl are not matchin with what is set in its respective config files
Please correct the above mismatches to rectify the issue
I faced the same problem and following is how i solved it.
Skype was using port 80, which is required by Apache server. therefore open skype and go Tools > Options > Advanced > Connection. Remove the tick "Use port 80 and 443 for additional incoming connections"
Open XAMPP Control panel and open "httpd-ssl.config" file and find the line "Listen 443" to another port (eg. "Listen 444").
Perhaps you have to configure the ports.
In XAMPP control panel, at Apache line you can see an button with the name "Config" on it. Click on it and then in "Apache (httpd.conf)". It opens a file and you have to scroll it down to a line where there's something like:
#Listen 12.34.56.78:80
#Listen 80
Change the line "#Listen 80" to "#Listen 8088".
Maybe it will solve the problem.
My log files were not populated Windows event viewer did not log errors as raised from apache. But starting apache from cmd line gave the error message could not bind the port 80.
I had skype running on port 80. Exiting skype didn't solve the issue. So I configured my port to 90 on httpd.conf file.
I had the same issues as many here, and was able to track it to apache/conf/extra/httpd-ssl.config. I had to comment out SSLCertificateFile "conf/ssl.crt/server.crt". However, this alone did not fix my issue, and running httpd from the CLI did not show any errors. I figured out I also had to set SSLEngine off in httpd-ssl.config.
Note: I did this on a local test server.

Xampp gives error while starting Apache HTTPd

Apache shutdown unexpectedly. This may be due to a blocked port,
missing dependencies, improper privileges, a crash, or a shutdown by
another method. Press the Logs button to view error logs and check the
Windows Event Viewer for more clues If you need more help, copy and
post this entire log window on the forums
I found that there was nothing in the logs, and the advice to go to the xampp root with a cmd and run apache_start.bat actually got the error (a missing path in the .conf file) which didn't show up any other way.
All working now.
If this is a fresh install, rather than using the control panel to start Apache, you may want to go to XAMPP's root directory and call apache-start.
In my case, apache was failing to start due to a configuration error
httpd.exe: Syntax error on line 37 of C:/..../xampp/apache/conf/httpd.conf:
ServerRoot must be a valid directory
If that's the case, make sure that you run setup_xampp (Thanks to https://stackoverflow.com/a/17978400/239408 !)
Most likely you have blocked port 80. The most common problem is skype, change skype settings to use a different port, and restart.
Then run apache.
IF you encounter this kind of error in XAMPP
"This may be due to a blocked port, missing dependencies,
improper privileges, a crash, or a shutdown by another method.
Press the Logs button to view error logs and check
the Windows Event Viewer for more clues
If you need more help, copy and post this
entire log window on the forums"
1) First thing you do is click the Netstat on the Xampp (it will give you the list of names, ports, address and PID)
2) Find the Port 80 and Check the Name who uses the port. for Example [httpd.exe]
3) Then go to the window task manager and click the processes
4) Find the Name of the application who uses the port. click the name and click end process
5) then back to the Xampp and click Start
Right click on Xampp Control Panel, and click on 'Run as Administrator'
That solved my problem.
I previously installed my XAMMP on one of my usb keys. Windows exchanged inadvertently their drive letters, making all my paths wrong in my XAMMP setup files. I changed back manually the drive letter of one key (before replugging the other one into my pc) so everything is ok again.
Hope this was helpfull.
JoVD.
As I am working in a corporate environment where developers faces firewall issues, none of the other answers resolved my issue.
As the port is not used by Skype, but by some other internal applications, I followed the below steps to resolve the issue:
Step 1 - From the XAMPP Control Panel, under Apache, click the Config button, and select the Apache (httpd.conf).
Inside the httpd.conf file, somehow I found a line that says:
Listen 80
And change the 80 into any number / port you want. In my scenario I’m using port 8080.
Listen 8080/1
Still from the httpd.conf file, I found another line that says:
ServerName localhost:80
And change 80 to 8080/1.
ServerName localhost:8080
Step 2 - From the XAMPP Control Panel, under Apache, click the Config button again, but this time select the Apache (httpd-ssl.conf). Inside the httpd-ssl.conf file, find line that says
Listen 443
And change the 443 into any number / port you want. I’ll using 4433 as the new port number.
Listen 4433
Still from the httpd-ssl.conf file, find another line that says
ServerName localhost:443
And change 443 to 4433.
ServerName localhost:4433
Remember to save the httpd.conf and httpd-ssl.conf files after performing some changes. Then restart the Apache service.

How to solve "Error: Apache shutdown unexpectedly"?

I've just re-installed XAMPP, and when I try to start my Apache server in the XAMPP Control Panel, I now get the following errors:
16:50:25 [Apache] Status change detected: running
16:50:26 [Apache] Status change detected: stopped
16:50:26 [Apache] Error: Apache shutdown unexpectedly.
16:50:26 [Apache] This may be due to a blocked port, missing dependencies,
16:50:26 [Apache] improper privileges, a crash, or a shutdown by another method.
16:50:26 [Apache] Press the Logs button to view error logs and check
16:50:26 [Apache] the Windows Event Viewer for more clues
16:50:26 [Apache] If you need more help, copy and post this
16:50:26 [Apache] entire log window on the forums
How do I solve this?
As I am working in a corporate environment where developers faces firewall issues, none of the other answers resolved my issue.
As the port is not used by Skype, but by some other internal applications,
I followed the below steps to resolve the issue:
Step 1 - From the XAMPP Control Panel, under Apache, click the Config button, and select the Apache (httpd.conf).
Inside the httpd.conf file, somehow I found a line that says:
Listen 80
And change the 80 into any number / port you want. In my scenario I’m using port 8080.
Listen 8080
Still from the httpd.conf file, I found another line that says:
ServerName localhost:80
Change 80 to 8080.
ServerName localhost:8080
Step 2 - From the XAMPP Control Panel, under Apache, click the Config button again, but this time select the Apache (httpd-ssl.conf). Inside the httpd-ssl.conf file, find line that says
Listen 443
And change the 443 into any number / port you want. I’ll using 4433 as the new port number.
Listen 4433
Still from the httpd-ssl.conf file, find another line that says
<VirtualHost _default_:443>
ServerName localhost:443
And change 443 to 4433.
<VirtualHost _default_:4433>
ServerName localhost:4433
Remember to save the httpd.conf and httpd-ssl.conf files after performing some changes. Then restart the Apache service.
Open Skype.
Tools -> Options -> Advanced -> Connection.
Uncheck the "Use port 80 and 443 for alternatives for incoming connections" checkbox
Sign Out and Close all Skype windows. Try restarting your Apache.
In XAMPP Control Panel V3.2.1, click on "NetStat" button on top right. Make sure port 80 is not used by any other program. Then click on "Shell" Right below it. Issue this command in the shell prompt;
Apache_Start.bat
or type "ap" then tab the TAB key two times which will similarly generate the above command.
You will actually see the exact error why Apache failed. It will be mostly likely virtual host configuration issue or may be something else. It will display the line number on which the error is occurring. Just fix that error. Note that in RootDocument a trailing \ can be a source of error as well. Remove any trailing "".
One thing you can do is to stop the services on port 80 by issuing
net stop http
in a cmd. You'll be asked if you're sure you want to stop those services. I found out that I had a few services I wasn't using and disabled them.
To see who else is using port 80 type in a cmd
netstat -abno
I'm assuming you want to run Apache on port 80. If this is the case and you want to keep the conflicting services you will need to associate them to a new port.
If the problem is not a busy port you can also try the following: select "show debug information" in the XAMPP config panel. When starting Apache you'll be shown something like "Executing "c:\xampp\apache\bin\httpd.exe". If you run that
c:\xampp\apache\bin\httpd.exe
in a cmd you will get some more information (I once for instance had some issue with my httpd.conf file).
Related: How do I free my port 80 on localhost Windows? and Apache won't run in xampp
Follow these steps:
Open your XAMPP control panel then click its "Config"
Choose the "Apache (httpd.conf)" and find this code below and change it into this one:
#Change this to Listen on specific IP addresses as shown below
#to prevent Apache from glomming onto all bound IP addresses.
#Listen 0.0.0.0:80
#Listen [::]:80
Listen 80
# Dynamic Shared Object (DSO) Support
Save it (Ctrl + S)
After that, go back to the XAMPP control panel and click its config again.
Choose "Apache (httpd-ssl.conf)", find this code below, and change it again:
# Note: Configurations that use IPv6 but not IPv4-mapped addresses need two
# Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443"
#
#Listen 0.0.0.0:443
#Listen [::]:443
Listen 443
Save it (Ctrl + S)
Then, click the "config" (note: above the netstat) and click the "service and port settings".
Change "Main Port" to 8080 and "SSL Port" to 4433, then save it.
Finally, go to the "control panel" -> "Programs & Features" -> "Turn Windows On or Off".
Uncheck your "Internet Information Services", and then click OK.
Just wait for it and your computer/laptop will be automatically restart and try to open your XAMPP control panel again, and then start your Apache.
My problem was that in httpd.conf the DocumentRoot and <Directory> entries were pointing to non-existing folders.
For example, the 'original' httpd.conf had the following entries:
DocumentRoot "c:/Apache24/htdocs"
<Directory "c:/Apache24/htdocs">
If you've installed in C:\xampp then you need to change those entries to match, i.e.
DocumentRoot "c:/xampp/htdocs"
<Directory "c:/xampp/htdocs">
This worked for me...
If you are using windows...
Search 'cmd' in the windows search bar.
Enter this:C:\xampp\apache\bin\httpd.exe
Find which file and which line the error occurred.
For example, mine was in the file below
on line 37.
httpd-multilang-errordoc.conf
Open the code and fix the error by either removing the line or fixing it.
Done! I should work now.
:)
If you're using Windows 7 . Search for IIS in Windows search (Click the Window icon in left bottom and type in where it says 'Search program and files') .
Open IIS (Internet Information Service) .
In the right side in actions panel. Click Stop.
Note: The stop link is faded in screen shot. As I've stopped it.
Problem Solved!
I had the same issue, and it turns out I forgot to run setup_xampp.bat (portable version).
It seems that no one has answered about executing xampp_start.exe.
I did all the previous answers but it did not fixed my issue. I found out that running xampp_start.exe will give you a detailed info about the issue.
This is what I see on my end:
As you can see I was having a path issue or xampp is pointing to non-existing folder.
When I found that there was no process using port 80 by using commands
netstat -abno | find ":80"
there was not a problem of any process using port 80.
Then I ran command (in cmd)
C:\xampp\apache\bin\httpd.exe
it showed some error in the virtual hosts configuration in httpd-vhosts.conf file which was recently edited by me for installation in a WordPress PHP environment in the Eclipse IDE. So I deleted those lines and Apache started perfectly.
The simple thing that you can do is to check if Skype or VMware is installed in your machine or not.
Skype uses port 80 and 443 as an additional port for incoming connections. To change the port number in Skype, go to
Tools > Connection Options > Connection
in the Skype window. Now change the default 80 port number to something other.
VMware Workstation uses port 443 for sharing. To change this, open VMware Workstation and goto
Edit > Preferences > Shared Vms
Click "Change Settings" buton
Then Click "Disable Sharing"
Then change the https port number being used (443)
Then you can click "Enable Sharing" button
That's all you have to do. Restart XAMPP and run the Apache server.
I had the same problem sometime back. I had a old laptop, on which almost all the ports were either blocked or were malfunctioning. This is how I did it.
Open the XAMPP control panel.
Click on Config
Then, go into Apache httpd.conf file. Open it with a text editor.
Search for "80" (Do Ctrl + F and find all of them. Replace it with 8080 or 4040 or 4000).
Save the file. And restart XAMPP.
It worked well for me, and I hope it helps you too.
For me, world wide web publishing-service was using port 80. I killed this by running the following command on cmd:
net stop http
After that, XAMPP ran Apache without any problems.
One of the causes could be that you are not running the XAMPP Control Panel as an administrator.
This error occurs because the port, which is allocated for Apache, is used by another program. To check the application which uses the port, which we allocated for Apache, it can be had by clicking,
Netstat button.
This is the Netstat file,
At first, I have allocated port 8080 for Apache, and I recently installed Oracle DB.TNSLSNR.exe has used 8080 port now.
So, by looking at this file we can choose a port which is not clashing with other applications. In my case, port 8060 is not clashing with any application. By selecting that we can change the httpd.conf file (XAMPP control panel -> Config) as mentioned above.
download new xampp apachefriends
install it
remove all VPN app
open folder XAMPP run setup_xampp.bat
run xampp-control.exe
Sometimes the issue is not a port issue but may be due to a misconfiguration that you did and Apache is not logging the error on the Event Viewer in Windows. To go around this, simply
cd C:\xampp\apache\bin
and then run
httpd.exe
Apache will then spit out the error for you e.g. as below
AH00526: Syntax error on line 2 of C:/xampp/apache/conf/httpd.conf: Invalid command 'This', perhaps misspelled or defined by a module not included in the server configuration
I hope that helps some poor soul :)
In my case, this issue was caused by an attempt to download other product of bitnami, like WordPress. That's common when we install WordPress via XAMPP. It is placed in the xampp/app directory that can be accessed from the XAMPP application homepage.
As a solution, I removed the default installed WordPress from the xampp directory and manually installed WordPress in the htdocs folder of WordPress by downloading it and extracting zip files into the htdoc folder. You also need to restart XAMPP or may system after uninstalling/removing the default WordPress. All is OK for me now.
Make at first sure your \xampp folder is in the root! This is important as the path is relative.
Then make sure you run the xampp_control.exe with admin rights.
Then change the files below to avoid issues with blocked port 80.
In \xampp\xampp-control.ini it should be set:
[ServicePorts]
Apache=8080
ApacheSSL=4433
Find \xampp\apache\conf\httpd.conf and set:
Listen 8080
ServerName localhost:8080
Find \xampp\apache\conf\extra\httpd-ssl.conf and set:
Listen 4433
<VirtualHost _default_:4433>
ServerName www.example.com:4433
Then end all services and restart xampp-control.exe with admin rights. It should run!
I have just encountered this error on my xampp v3.2.2 [win 10 pro x64],
I first tried to run the "net stop http" command in an admin cmd, but it didnt solve the issue, so I went ahead to try the "netstat -abno" command and i found out that the ssl port(443) was in use by vmware.
so my advice, don't just look for what's blocking port 80, also look for potential programs using port 443. because I really don't like changing my default port numbers to 8081 and 4433.
So this is how you can solve this issue...
firstly type the following command
net stop http
then try to start apache, if it still doesn't work. type out the following command
netstat -abno
and you'll definitely get that troublesome app that's using up your precious port.
copy the pid and then use the following command
taskkill /f /pid PID
where PID is the pid you copied.
Hopefully this helps someone.
In my case port was already used by windows IIS service.
You can check if port is being already used from cmd. Open cmd and run this command:
netstat -ano
If it is being used by IIS you can stop it by following command. Open cmd as administrator, then:
iisreset /stop
Now try running XAMPP, it should work.
You can run apache_start.bat file from XAMPP directory for see details about your error details.
Try the following, none of the above solved it for me
Select "Run as administrator"
Then click on the big left box next to Apache
And Choose to uninstall Apache
I have no idea why this worked but it solved my problem directly!
Step 1: In Apache go to Config then select Apache(httpd.conf)
In the notepad, find Listen 80 and add another 80 to change the port to become Listen 8080
Make sure to save before closing the notepad.
Step 2: In Apache go to Config the select Apache(httpd-ssl.conf)
In the notepad, find Listen 443 and add another 3 after 443 to change the port to become Listen 4433
Then search for VirtualHost default:443 and add another 3 to change the port to become VirtualHost default:4433
Make sure to save before closing the notepad.
(Note: There is a similar answer here but it did not work for me until I fond a video on YT)
I solved the problem with stopping the service "Web Deployment Agent Service". Open: System -> Computer Management -> Services -> Web Deployment Agent Service. Stop this service and starting XAMPP works.
I think this is a service by MS Webmatrix.
(German: Systemsteuerung -> System und Sicherheit -> Verwaltung -> Dienste -> Webbereitstellungs-Agent-Dienst)
Best solution
open XAMPP control panel,click on config for Apache, then click on Apache(httpd.config).now in the text editor . ctrl+f --> find "Listen 80" and replace it with "Listen 8079" wtihout the quotations :)
but now you have to use it like this http://localhost:8079/
P.S, I tried to change port settings for skype , stopping the Web Deployment Agent Service which I could not find in windows 10,cmd--> net stop http, and other methods but nothing worked except this .
I had the exact same error message as the OP, but my problem was not addressed by any of the existing answers. Many of the answers deal with conflicts on port 80, which I knew I did not have, since I had had localhost responding on port 80 very recently.
Turns out I had inadvertently changed ServerRoot when I intended to change DocumentRoot (stupid, I know), and though the new ServerRoot directory existed, it did not contain the configuration files and other stuff apache needed, which caused it to fail on startup. The error message probably addresses this scenario by the wording 'missing dependencies'.
On my Windows system, setting ServerRoot back to C:/XAMPP/apache solved the problem.
The Apache server by default runs on ports 80, 443. Your problem is one or both of the two ports are busy. Usually Skype or VMware Workstation use these two ports. So, make sure that they're not running. The best way to make sure the ports are free on windows is :
Click windows button.
In the search bar type resmon, to open the resource monitor resmon.exe.
Open Listening Ports, this will show you the opened used ports.
Now you can see which process is using ports 80 and 443.
Then you can kill the process either from CMD using its PID (which is shown in the resource monitor), or directly from Task Manager.
To kill a process from CMD using PID type Taskkill /PID 26356 /F, where 26356 is the PID.
Best Solution for windows user is :
Open netstat (from XAMPP CONTROL PANEL)
Find PID of process which uses port 80.
Open CMD with Administrative.
Run taskkill /pid PID (instead PID use pid u found from netstat)
Heyy enjoy u Done.....

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.
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
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, try closing it and then running xampp, if it works then change the skype port to stop using port 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
logout your account in skype.. then in xampp control panel click start from the line of 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 I simply had to run the control panel as administrator
just disable "world wide web publishing service" , it solve my problem.
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.
Apache
MySql
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.