454

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?

2
  • 1
    I started having this problem after installing a new version of XAMPP. I thought the problem was about ports, since almost every post talks about them, but it wasn't. When I checked the error.log, I saw PHP Warning: 'vcruntime140.dll' 14.0 is not compatible with this PHP build which led me to this answer. Installing the required redistributable solved the problem.
    – akinuri
    Apr 22, 2020 at 14:22
  • I had the same problem, but changing the ports did nothing. Instead I typed xampp in Windows menu, then right clicked on it and selected "Run as administrator". After that I could start everything as usual.
    – peter70
    Mar 28 at 9:58

58 Answers 58

962

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.

27
  • 9
    I upgraded to Windows 10 and XAMPP wasn't working. I followed your solution and it worked fine.
    – user379888
    Aug 27, 2015 at 8:10
  • 11
    This is the fix for the windows 10 bug. Thanks alot !
    – Javed Ali
    Jun 27, 2017 at 18:26
  • 7
    Works for me. This should be the accepted solution; the Skype solution is very limited.
    – ptrcao
    Dec 1, 2018 at 23:06
  • 7
    I have made the changes for 80 and 443 ports but still shows the error there is no skype in my system Feb 13, 2019 at 11:35
  • 7
    Seems like the second line on httpd-ssl.conf that needs to be edited is called: ServerName www.example.com:4433
    – Shayan
    Oct 21, 2020 at 15:40
441

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.

16
  • 12
    if its not working for anyone try to check error logs. or if you are using vmware got to EDIT > PREFERENCES > SHARED VMS > DISABLE SHARING and change port from 443 to any other port e.g 8443 and save changes. restart xampp or wamp Dec 6, 2014 at 13:36
  • 9
    I changed skype, still noting. The solution ended up being (stackoverflow.com/questions/14548768/… setup_xampp.bat to refresh the paths]
    – Timmah
    Feb 7, 2015 at 1:35
  • 29
    This is not the correct solution as the port may be blocked due to any application, not only Skype. The 2nd highest upvoted answer has a better solution. Dec 14, 2015 at 1:20
  • 3
    This is the most common issue people facing though this was not the issue in my case. This issue may also arise if you have wrong entries in any of these files httpd.conf and httpd-vhosts.conf. In my case I had a virtual host created which points to file location on my external hard drive and while I was running xampp my external hard drive was not connected. So, I commented out that virtual host code till the time I was not using external hard drive and restarted xampp to fix the issue. Feb 15, 2016 at 7:36
  • 3
    It's not always skype. My problem was with vmware which was using port 443. If that is the case you don't have to change port 80 config.
    – Moradnejad
    May 25, 2016 at 6:32
167

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 "".

7
  • 17
    This should be the top answer, because it works for any possible error with XAMPP!
    – user11153
    Nov 1, 2016 at 11:13
  • Very helpful, even though I was not using a VM I was able to find out that the DirectoryRoot no longer existed. This is a reminder that one should always comment projects. The most simplest of things can waste time if there are no notes. Especially if picking up a project left behind by another developer. :)
    – mcv
    Sep 12, 2017 at 13:10
  • Needed this. Turns out that I was missing a logs file in my custom directory.
    – shemake
    Aug 31, 2019 at 3:55
  • This fixed it for me as it was a syntax error because the directory was misspelled. That extra debug info should really be included in the white text field in the control panel of the XAMPP GUI.
    – Setz
    Oct 17, 2019 at 19:37
  • @Hammad Khan, thanks a lot! I didn't have any entries (even not error ones) in log files - just that generic red error in XAMPP console about a blocked port, missing dependencies etc. Changing port didn't help. After running this bat command via Shell button it turned out that root directory served by Apache is invalid - i changed it a few months ago, but haven't run XAMPP to check if it still works at that time and have forgotten about it until today. ;) Dec 31, 2020 at 10:52
118

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

8
  • 13
    +1 for httpd.exe. If you're getting missing modules, make sure your antivirus hasn't deleted them (especially if you run Kasperky).
    – thomas88wp
    Sep 10, 2014 at 20:46
  • 2
    I had the same problem and solved it by making sure that each directory specified in /apache/conf/extras/httpd-bhosts.conf were actual paths.
    – Matthew
    Mar 20, 2015 at 23:43
  • 9
    thanks man running c:\xampp\apache\bin\httpd.exe on cmd threw the exact error and able to fix it Jun 1, 2015 at 5:59
  • This wordk on 2019 server. net stop http does the trick it stops all services using that port. This service I emoted to manual start up.
    – Henry
    May 14, 2019 at 19:30
  • 1
    Executing the c:\xampp\apache\bin\httpd.exe worked for me. Thank You :) Feb 13, 2020 at 5:05
44

Follow these steps:

  1. Open your XAMPP control panel then click its "Config"
  2. 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

    1. Save it (Ctrl + S)
    2. After that, go back to the XAMPP control panel and click its config again.
    3. 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

    1. Save it (Ctrl + S)
    2. Then, click the "config" (note: above the netstat) and click the "service and port settings".
    3. Change "Main Port" to 8080 and "SSL Port" to 4433, then save it.
    4. Finally, go to the "control panel" -> "Programs & Features" -> "Turn Windows On or Off".
    5. 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.

5
  • 11
    Watch out. If you have VMWare Workstation installed (10.0), the option to share VM's is listening to port 443. That is preventing an Apache-server to start (xampp). See Edit > Preferences > Share VM's
    – toesslab
    Nov 30, 2013 at 8:19
  • 4
    Listen 80 --> Listen 81 (near line 58) ServerName localhost:80 --> ServerName localhost:81 (near line 218) Mar 13, 2014 at 8:02
  • 2
    Worked for me. I was trying to change the Apache port using the XAMPP 'Config GUI' and had no luck. Changed it manually and it all worked. Another harsh lesson for laziness.
    – Matt Carr
    Apr 14, 2014 at 18:31
  • Finally the solution for me. I already changed the skype thing, but it didn't help. Thank you! (: The only problem was point 3&4 in the last part of your description.
    – codepleb
    Jun 15, 2014 at 11:32
  • Worked for me, I am using windows7 without VMware. + 1 Nov 20, 2014 at 1:21
36

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">
4
  • I renamed folders and that was caused invalid root http folder and did not let XAMPP to start. chaninging folder names to right ones fixed this :)
    – VSB
    Aug 22, 2014 at 11:09
  • 2
    +1, I totally forgot that I restructured my folders =) Aug 23, 2014 at 19:09
  • Me too - "... but I didn't change anything!..." yeah, except the root directory name -- oops. ;)
    – CramerTV
    Aug 25, 2014 at 17:40
  • 2
    nothing but a simple answer reminding one of one's own idiocy sometimes .. :D that did it for me, thanks! May 5, 2015 at 18:24
32

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.

:)

5
  • thanks. its worked. there was syntax error in my vhost config file Aug 24, 2019 at 5:59
  • The error log file was empty in my case. Using this method I found where was the problem. Perfect.
    – Andrei
    Jan 20, 2021 at 17:23
  • Thanks mate. For me it was this line in httpd-vhost.conf - ErrorLog "logs/example-app/-error.log". When i commented it, voila!
    – Brendan
    Mar 25, 2021 at 7:46
  • Thanks, this gave me an exact error log of what i exactly butchered in the httpd-vhosts file
    – yourivdloo
    Feb 10 at 9:44
  • for me this showed me this error: Cannot load C:/xampp/php/php7ts.dll into server: The specified module could not be found.
    – Ali Samie
    Feb 19 at 14:22
25

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. IIS Screenshot Problem Solved!

3
  • 2
    On Windows 10 could not find IIS to execute, then I uninstalled IIS from Control Panel > Programs > Programs and Features > Windows Components which finally solved it.
    – escalator
    Jun 17, 2016 at 13:44
  • @escalator well, I have clearly mentioned that "If you're using Windows 7" . Feb 21, 2017 at 14:00
  • 1
    Thanks. Worked like a charm and solved the issue for me after having tried unsuccessfully several of the other mentioned tricks. The net stop http from an elevated command prompt was also working, but had the side effect making the printers unavailable.
    – OuzoPower
    Sep 18, 2019 at 15:28
24

I had the same issue, and it turns out I forgot to run setup_xampp.bat (portable version).

5
  • 3
    After moving my xampp folder to another drive than c:\ apache didn't start anymore. This solution worked for me. Thanks alot! :) Nov 4, 2014 at 20:05
  • I think this step is mandatory, when we download the Xampp software as a zip archive and try to start Apache server. Dec 7, 2015 at 13:31
  • 1
    This is the answer for portable version (my case). Thanks for pointing it out. May 11, 2016 at 18:48
  • It solved my issue too. I'm not on a portable version. I downloaded the setup for xampp on Windows 10. After the installation (it was an exe not a zip), I had the problem described in the first post. After searching a solution to this problem I run the setup_xampp.bat and now it is working.
    – quokka-web
    Oct 16, 2017 at 8:16
  • My Windows got corrupted due to which drive names got changed and the absolute file paths were in total mess. I ran setup_xampp.bat and everything was re-configured properly.
    – gegobyte
    Nov 5, 2018 at 17:33
16

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:

xampp_start

As you can see I was having a path issue or xampp is pointing to non-existing folder.

2
  • This was life saver. my ssl and logs file path was invalid. this helped me correct it and its working now.
    – Ali Azhar
    Nov 26, 2019 at 6:38
  • This allowed me to solve my issue, which was a wrong directory Feb 25, 2021 at 17:27
13

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.

3
  • 2
    Perfect! I had specified wrong directory for log files and hence it was not starting. Fixing that fix the problem!
    – TheTechGuy
    Feb 28, 2015 at 14:22
  • YOU ROCK!!!! All above solutions didn't work for me, when I tried what you did it gave me a different error about SSLRequiredSSL line in httpd-xampp.conf which I then inserted # in front of it to disable it. By the way, I had to reran C:\xampp\apache\bin\httpd.exe many times in the command line after each fixing to find me another lines which had same error.
    – alaswer
    May 11, 2016 at 19:08
  • This comment has saved me sooooooo many times. This should be the right answer. Any time I have a problem with XAMPP, it gives the same generic message in the control panel: "Apache shutdown unexpectedly". I just ctrl+v that command above into the terminal and I get an actual error message with a reason why Apache shutdown unexpectedly! I guess the XAMPP developers just never understood the value of detailed error messages. Thanks again @JDP! Jul 11, 2020 at 1:28
12

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

  1. Click "Change Settings" buton
  2. Then Click "Disable Sharing"
  3. Then change the https port number being used (443)
  4. Then you can click "Enable Sharing" button

That's all you have to do. Restart XAMPP and run the Apache server.

1
  • After making skype change, apache was still not starting, so I did the mentioned VmWare change and it worked. Jul 14, 2015 at 0:09
11

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.

  1. Open the XAMPP control panel.

  2. Click on Config

  3. Then, go into Apache httpd.conf file. Open it with a text editor.

  4. Search for "80" (Do Ctrl + F and find all of them. Replace it with 8080 or 4040 or 4000).

  5. Save the file. And restart XAMPP.

It worked well for me, and I hope it helps you too.

0
8

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.

3
  • 1
    that solved my problem, but now we stopped some services, how those services affect my networking?
    – Karavana
    Aug 13, 2014 at 8:03
  • I ran command prompt as admin and this worked. But my question is, will stopped services not effect normal computing, and, how again I will get those were stopped, up and running again. Apr 29, 2017 at 19:21
  • @AMRESHPANDEY I found something that might be useful in that case. I didn't try if it works though. Feel free to add it as an answer if it works: mikeplate.com/2011/11/06/… May 1, 2017 at 6:53
7

One of the causes could be that you are not running the XAMPP Control Panel as an administrator.

2
  • This is the first thing must be checked! Thanks
    – ganji
    Jul 9, 2020 at 10:00
  • 1
    This should be up a the top of the answer list.
    – RockBoro
    Mar 4 at 0:58
7

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

0
6

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.

XAMPP homepage

This is the Netstat file,

Enter the image description here

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.

6

Try the following, none of the above solved it for me

  1. Select Run as administrator

enter image description here

  1. Then click on the big left box next to Apache

  2. Choose to uninstall Apache

enter image description here

5
  1. download new xampp apachefriends
  2. install it
  3. remove all VPN app
  4. open folder XAMPP run setup_xampp.bat
  5. run xampp-control.exe
1
  • I have been followed point 4, run setup_xampp.bat and started services (point5), all are working fine. Feb 21, 2018 at 5:40
4

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.

0
4
  1. Make at first sure your \xampp folder is in the root! This is important as the path is relative.

  2. Then make sure you run the xampp_control.exe with admin rights.

  3. 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!

4

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.

4

You can run apache_start.bat file from XAMPP directory for see details about your error details.

1
  • Thanks, it helps. I have an error in http-vhosts.conf file. Jul 8, 2020 at 7:41
4

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)

4

Update 2023:

I found a quicker/faster way to resolve this without looking through the long list of services and ports, you can use this.

netstat -ano | findstr <Port Number>
taskkill /F /PID <Process Id>

make sure to change:

  • <Port Number> to the port you need either 8080 or 443.
  • <Process Id> to the PID of the service or app using the port.

Original 2019 post:

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.

0
2

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)

2

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 .

2

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.

2

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.

2

Best Solution for windows user is :

  1. Open netstat (from XAMPP CONTROL PANEL)
  2. Find PID of process which uses port 80.
  3. Open CMD with Administrative.
  4. Run taskkill /pid PID (instead PID use pid u found from netstat)
    Heyy enjoy u Done.....

Not the answer you're looking for? Browse other questions tagged or ask your own question.