[apache] XAMPP, Apache - 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?

This question is related to apache xampp

The answer is


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

  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!


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 .


This happend due to default port 80 is blocked for Apache. You need to change the port or make the port accesible.

Go to your Apache configuration (httpd.conf) file in the Apache installation.

Find these lines:

#

Listen 192.168.1.2:80

Listen 80

#

Here 192.168.1.2 is my private IP address. Change it according to yours.

Change as below

Listen 192.168.1.2:8081

Listen 8081

Now when you access localhost you have to add the port explicitily as http://localhost:8081/...


If you are using Skype, you will get this error.

Just press Ctrl+Alt+Del goto Task Manager select Skype and click End Task then go back and start the Apache once Apache starts successfully. Then open the Skype again now both will work well.

Not necessary to change any port.


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


Most probably you have another running "mysqld" process kill it then rerun xampp MySQL you don't get any error.


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.


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.


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

Select "Run as administrator"

enter image description here

Then click on the big left box next to Apache

And Choose to uninstall Apache

enter image description here

I have no idea why this worked but it solved my problem directly!


Usually, xampp port error occurs because the default port 80 xampp trying to access is in use by another application. Most of the times this application is Skype.
So, you have 2 methods to solve this problem:

  1. Close or Terminate the process/application that is using the port.
  2. Use some other port for your xampp application. (I personally prefer this method).

These methods are well explained in this post How to debug xampp port 80 error


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.


i also got the same error and i was uninstall vmware to fix that error.


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!


Even i had this issue and i resolved it, in my case it was different.

first i tried uninstalling the skype but that didn't work. but in my windows 10 desktop, i had the IIS(Internet Information Server) installed by default which was pointing to port 80.

All i did is i changed the port number to 8081 and just restarted XAMPP, and that worked for me.

however i was not using IIS.

here is the link to https://support.microsoft.com/en-in/help/149605/how-to-change-the-tcp-port-for-iis-services


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


The solution is uninstall the xampp and reinstall it. it will be work


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.

:)


Ok for my case it was really simple.

I set to a local IP address at my Ethernet port.

Then having this error. Turns out I did not connect the cable to it, so the IP does not resolve to the IP set in Apache.

Solution was to connect the cable to a switch or router. Then able to start Apache.


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.


You can go with the solutions mentioned above. This issue can be resolved by making changes in your "httpd.conf"(C:\xampp\apache\conf\httpd.conf) file and "httpd-ssl.conf"(C:\xampp\apache\conf\extra\httpd-ssl.conf) file. If still the issue persists you can check with your skype port.

But in my case this was different. I had to make changes in "server.crt"(C:\xampp\apache\conf\ssl.crt\server.crt) file.Try running your xammp apache from the command line in administration mode. "C:\xampp\apache\bin\httpd.exe" This will give you the errors -in which file and -which line. Likewise, I had an error in server.crt file which was blank. If you have xammp running in any other system, just copy the contents of this file(C:\xampp\apache\conf\ssl.crt\server.crt) and paste in your server.crt file and You are Done!

Thanks and Regards Archana


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


Installing the latest 5.6.12 from 5.6.8 on Windows 8.1 worked for me.


If changing the port didn't solve the problem as suggested above, and if you had probably played around with the file directory structure (for instance, change the name of the folder after installation like I did) then you can try this,

  1. Open XAMPP Control Panel and click Apache's "Config"
  2. Choose the Apache (httpd.conf)
  3. In the editor that opened, press CTRL+H and find all instances of the old folder name and replace it with the new one.

For example, In my case, I had changed the main installation folder name of XAMPP from Xam to Xampp

So in the editor change this:

Define SRVROOT "G:/Xam/apache"
ServerRoot "G:/Xam/apache"
DocumentRoot "G:/Xam/htdocs"
<Directory "G:/Xam/htdocs">

To

Define SRVROOT "G:/Xampp/apache"
ServerRoot "G:/Xampp/apache"
DocumentRoot "G:/Xampps/htdocs"
<Directory "G:/Xampps/htdocs">

There are many other such instances in the editor, just find and replace each and every one of them.

Also do the same for, Apache (httpd-ssl.conf).


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.


Alright, no port 80, no Skype blame! My problem was indeed quite simple(&silly), I had an extra backslash (\) (on Windows) after the path I'd specified for the DocumentRoot directive, so I made a change like this and the problem is gone like a duck soup.

My index.php was in the path "D:\websites\dummy" and my httpd.conf was like this:

<VirtualHost 127.0.0.2:80>
ServerName dummy.local
DocumentRoot "D:\websites\dummy\" #mistake here
</VirtualHost>
<Directory "D:\websites\dummy\"> #mistake here
    Require all granted
</Directory>

So just change those two lines like this:

#first mistake fix:
DocumentRoot "D:\websites\dummy"
#second (similar) mistake fix:
<Directory "D:\websites\dummy">

...and everything's fine now. To prevent such mistakes in future, always copy the path of any folder you want to refer to instead of typing it yourself.


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.


  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

If all the answers above fail to work, Do this. comment out all the extensions in php.ini file.

  1. In xampp control panel, click on Apache config.
  2. click on php.ini
  3. In php ctrl + F (extension) to find all extensions in your php.ini
  4. Comment out each and every active extension by adding a ; at the start of each extension line. example

    ;;;extension=bz2

  5. i put 3 ;;; because i wanted to know ones i commented out so that when i come back to deburg which one had a problem, it was easy for me to see which ones i commented out.

  6. Make sure all extensions=whatever are commented out.

  7. Run your apache server.

  8. To pickup which extension was the problem, one by one un-comment your extensions while restarting your server until you catch the culprit.


Same error. Turns out I had the wrong version of zend xdebug extension loaded. The xdebug wizard said to use the TS (Thread Safe) version (i.e. withOUT -NTS-), but apparently I downloaded the incorrect NonThread Safe version. Even though I had the path and file name accurate in the php.ini file, I was still getting the error. When I downloaded the different version, and updated php.ini again, everything worked well.

php_xdebug-2.7.0-7.3-vc15-nts-x86_64.dll gave me an error, but no error with php_xdebug-2.7.0-7.3-vc15-x86_64.dll


I followed @user2314737's advice (his answer is on page 1) and enabled "Show debug information" under "Config" that after a restart of xampp showed me that my install path had a space " " in it which wasn't allowed.

My path was D:\Program files (x86)\xampp\ so I reinstalled it to D:\xampp\ and then it worked.


First of all you should verify that you have no excess virtual hosts in your httpd-vhosts file. I mean following simple rule: 1 project = 1 virtual host in config file. Otherwise you'll face with error even if you'll change ports etc.


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.


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.


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.


In my case I edited the http.conf file for I wanted localhost to be accessible by other computers on the network and did not set a static IP on my network adapter. I also checked netstat and saw nobody was using port 80.
So I opened cmd and typed

ipconfig

I also opened the http.conf and searched(CTRL + F) for "Listen 80". The line above it, if not commented, enables localhost to be accessible over the network. It should look something like this:

Listen 192.168.93.3:80

Comparing the result from ipconfig command, I saw that my current ip address isn't the same as the one on the http.conf file. So I changed the ip address on the http.conf file with the one currently assigned to me and it worked.


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.


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.


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.


In my case it was much easier. I turned off the native windows firewall. Then re-loaded comp launched xampp and started apache again. Then turned the firewall on back.


For me, this problem began when I hosted a VPN-connection on my Windows 8 computer.

Simply deleting the connection from "Control Panel\Network and Internet\Network Connections" solved the problem.


Trick that works for me is,

Starting XAMPP as administrator

I tried changing ports using httpd.config and httpd-ssl.config. It ended my saving it in .txt file. Also used config on the right top. None worked

I am using VMworkstation.


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


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 "Type ap then TAB two times"

Apache_Start.bat

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


Note that whenever you change the default ports, your browser will not know about that. 80 and 443 seem to be standard in some way, so for example, if you changed 80 to 8080, you'll have to access your websites this way then:

localhost:8080/path_to_your_website.php


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)


I had the same problem (on Windows 8.1), but I fixed it just by extracting to C:\ instead of C:\somefolder as I did at first. So the path to the control panel, for example, is now C:\xampp\xampp-control.exe


I received the same error above and what caused it for me was that in the file 'httpd-vhosts.conf' I put a comment inside the <Directory> tags like this...

<Directory "*PATH TO MY FOLDER*...">
        AllowOverride All
        Require all Granted    ## This directive could/should be set to denied.
</Directory>

Once I removed the comment, Apache started. I guess I should have put the comment on its own line. I just thought, like other web code, it could be there.


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.


In my case this happened after installing sql server and the solution was as described in this answer

Xampp - Can't start Apache after install SQL Server and Visual Studio

so I had to just disable "SQL Server Reporting Services" service from Windows services


I tried to execute httpd.exe in cmd and got error that there's syntax error in httpd-vhosts.conf. I checked file and found what's wrong and it's working fine now.

So, if you are facing this error then it may be because of httpd-vhosts or any other file.

Try to execute the program via cmd and you will get the error details and the line where is syntax error.

Best of luck


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

In my case, I got this problem coz Bitnami Wordpress was active.

  • Open the Bitanami App
  • Go to Manage Servers
  • Make Sure to stop MySql and Apache
  • Restart xampp and it will work.

Bitnami Manage Servers