How to solve "Error: Apache shutdown unexpectedly"?
Asked Answered
D

59

460

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?

Dereliction answered 18/8, 2013 at 14:58 Comment(3)
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.Trochaic
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.Bernabernadene
I had same issue. The logs shown are not clear. So run the apache_start.bat, and it showed me exactly what was wrong.Bohlen
R
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.

Rhubarb answered 25/9, 2013 at 2:57 Comment(16)
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 wampBandaid
I changed skype, still noting. The solution ended up being (#14549268 setup_xampp.bat to refresh the paths]Colunga
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.Impacted
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.Burse
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.Selfabsorption
As @RahulKadukar agree with you. This answer didn't work for me. And the other answer you've mentioned worked fine.Arawn
I had to downvote this, even if it was right for me. The answerer should have understood and mentioned that any other app could be using those portsReiss
@hmd tips is a top answer, because it works for any possible error with XAMPP !!!Sevilla
Hi I am using Skype for Business, and i cannot see Connection option in ToolsBalls
What a genius.. How did he even know OP had Skype installed?Tapioca
@HidaytRahman did you find the Tools option ? :) I am in the same situation and I had to solve the issue with Min2's solutionGradygrae
This is not the right solution. It may be from any application which is using same port.Stegall
If IIS is turned on same error will occure. If so then stop it and try again. Or you can change port 80 to some other ports and use localhost:portnumber(ex: localhost:8081). This can be done through Config - Service and Port Settings and change the main port number and save.Croteau
I don't have Skype installed. This might be a trick, but for sure not an universal answer to the problem.Printery
For those trying out this in 2020, the classic version of skype is not supported. Try the answer by Min2 to change port of XAMPP Control Panel.Phallic
I have Skype version 8.64.0.80 and the solution is not working for me. Rather go for changing Apache port from XamppControlPanel>Apache>Config>httpd.conf>"Listen 80", Change port from 80 to your desired number ranges 0 to 65535Warty
I
970

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.

Inconvenience answered 21/12, 2014 at 11:11 Comment(27)
The answer provided by @Inconvenience works in every case, but sometimes this fails since you need to check if there is a service named "Apache HTTP Service" running in Task Manager. End this service and perform the above defined functions, you will now find Apache working.Tammany
I upgraded to Windows 10 and XAMPP wasn't working. I followed your solution and it worked fine.Contrarily
I just changed port 80 to 100 in httpd.conf file and did not touch httpd-ssl.conf file and it worked !Clemmer
can someone explain why this works? I don't understand, if I have no IIS enabled, why this works? ok, I can see why the port 80 would be blocked, for security reasons? but what about the other settingUnsettle
One other thing you may find useful to get the Admin buttons pointing to the right URLs in the XAMPP Control Panel. Open the main Config of the Control Panel, click on Service and Port Settings, and change the ports to 80 and 4433.Vassal
I changed only the HTTP ports thinking that I wouldn't need the HTTPS ports at all. After wasting an hour, when I changed the HTTPS ports too, apache started successfully. Thanks for your solution.Copaiba
Worked for me after trying to disable Skype an AVG with no success. ThksRafi
This is the actual solution, and should be accepted. The others all involve monkeying with unrelated programs to free up the default port; this one should work for all time (assuming you give your xampp port a unique-enough number).Iou
still not working. I have reinstall window and run it again but it still notices that problem. Please help meHeartrending
This is the fix for the windows 10 bug. Thanks alot !Etymology
Thanks, It works fine for Windows 10, and of course you must update both file.Rossini
Still the best solution for 2018!Pomander
just make sure that when you do this... your localhost will then be accessible by 127.0.0.1:8080 or localhost:8080 . also make sure to update the localhost url in any local domains (host file)...Arms
That worked ok for me in windows 10, but I did not need the second step, change 80 to 8080 was enough.Beryllium
Works for me. This should be the accepted solution; the Skype solution is very limited.Spoilt
Why is this not the best answer! I could have save at least 10 minutes of my life. Anyway! Thanks a lot it workedInterpolate
I have made the changes for 80 and 443 ports but still shows the error there is no skype in my systemSpringhalt
Why does it fix the problem ? Which is the root cause here ? (It also solved the issue on my side, but it is not clear the reason)Gradygrae
This supposed to be the Selected answer! I'm running windows 10 pro vr 1809 and it's fix my problem. I am up and running with Xampp server again! Thank you very much. you saved a day!Bolt
In the XAMPP Control Panel (v3.2.4), we also need to click on the Config button at the upper-right-most. Then a window called "Configuration of Control Panel" will launch. Then we need to click on the "Service and Port Settings" to update the port numbers as well, otherwise, the "Admin" button of Apache will still point to port 80.Ingoing
Sometime 8080 port still not work. I am changing it with 8081 and now it's working fine.Ervinervine
This happened after Windows 10 Update! :/ ThanksRoam
Seems like the second line on httpd-ssl.conf that needs to be edited is called: ServerName www.example.com:4433Evincive
For anyone who still have problem starting apache even after changing all the port settings in given answer, check if running xampp control panel as administrator fixes your issue. I've set xampp to always run as administrator and that worked for me.Vandalize
This works for me. I edited ServerName www.example.com:4433 on httpd-ssl.confIndoaryan
this answer fixed my issued. simply changed port number and it worked,,, ThnxHyperextension
if error is just one port (80), then follow step one.Gantline
R
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.

Rhubarb answered 25/9, 2013 at 2:57 Comment(16)
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 wampBandaid
I changed skype, still noting. The solution ended up being (#14549268 setup_xampp.bat to refresh the paths]Colunga
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.Impacted
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.Burse
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.Selfabsorption
As @RahulKadukar agree with you. This answer didn't work for me. And the other answer you've mentioned worked fine.Arawn
I had to downvote this, even if it was right for me. The answerer should have understood and mentioned that any other app could be using those portsReiss
@hmd tips is a top answer, because it works for any possible error with XAMPP !!!Sevilla
Hi I am using Skype for Business, and i cannot see Connection option in ToolsBalls
What a genius.. How did he even know OP had Skype installed?Tapioca
@HidaytRahman did you find the Tools option ? :) I am in the same situation and I had to solve the issue with Min2's solutionGradygrae
This is not the right solution. It may be from any application which is using same port.Stegall
If IIS is turned on same error will occure. If so then stop it and try again. Or you can change port 80 to some other ports and use localhost:portnumber(ex: localhost:8081). This can be done through Config - Service and Port Settings and change the main port number and save.Croteau
I don't have Skype installed. This might be a trick, but for sure not an universal answer to the problem.Printery
For those trying out this in 2020, the classic version of skype is not supported. Try the answer by Min2 to change port of XAMPP Control Panel.Phallic
I have Skype version 8.64.0.80 and the solution is not working for me. Rather go for changing Apache port from XamppControlPanel>Apache>Config>httpd.conf>"Listen 80", Change port from 80 to your desired number ranges 0 to 65535Warty
J
176

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

Jackdaw answered 28/2, 2015 at 17:20 Comment(9)
This should be the top answer, because it works for any possible error with XAMPP!Songsongbird
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. :)Praetor
Needed this. Turns out that I was missing a logs file in my custom directory.Smite
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.Pumice
@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. ;)Tomtit
Cannot load C:/xampp/php/php8ts.dll into server: The specified module could not be found. how to resolve thisMolding
@AzharUddinSheikh this would mean, the file C:/xampp/php/php8ts.dll does not exist in the location. Maybe copy the file or re-install?Jackdaw
Thanks for this answer! In my case, I had deleted one of my project folders but forgotten to remove the entry from the vhosts file.Lallage
Experts Decision! Exact Solution.Malinger
B
119

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

Buccal answered 5/9, 2013 at 21:17 Comment(8)
+1 for httpd.exe. If you're getting missing modules, make sure your antivirus hasn't deleted them (especially if you run Kasperky).Amimia
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.Urbanus
thanks man running c:\xampp\apache\bin\httpd.exe on cmd threw the exact error and able to fix itSidman
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.Vicenta
If you're using Windows 7, preferably see Kunal's answer which tells how to stop IIS. About this trick, net stop http worked, but had the side effect of making the printers no longer listed when trying to print something (and until rebooting the computer).Printery
Executing the c:\xampp\apache\bin\httpd.exe worked for me. Thank You :)Simile
There is a FAQ "How can I get XAMPP working on port 80 under Windows 10?" on the xampp download page. This solution worked for me as apparently IIS was running on Windows 10 and caused a conflict.Pianissimo
i had error ``` AH00526: Syntax error on line 29 of C:/xampp/apache/conf/extra/httpd-vhosts.conf: Invalid command ';', perhaps misspelled or defined by a module not included in the server configuration ``` i just removed ';' and woah it worked like a charm thanks @BuccalCoagulate
C
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.

Chanell answered 22/8, 2013 at 12:43 Comment(5)
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'sAlvira
Listen 80 --> Listen 81 (near line 58) ServerName localhost:80 --> ServerName localhost:81 (near line 218)Mayne
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.Serai
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.Fullfledged
Worked for me, I am using windows7 without VMware. + 1Vergara
R
37

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">
Reentry answered 6/5, 2014 at 21:32 Comment(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 :)Tralee
+1, I totally forgot that I restructured my folders =)Clothespress
Me too - "... but I didn't change anything!..." yeah, except the root directory name -- oops. ;)Reentry
nothing but a simple answer reminding one of one's own idiocy sometimes .. :D that did it for me, thanks!Splitlevel
C
33

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.

:)

Cichocki answered 27/3, 2019 at 20:24 Comment(5)
thanks. its worked. there was syntax error in my vhost config fileIncise
The error log file was empty in my case. Using this method I found where was the problem. Perfect.Servomotor
Thanks mate. For me it was this line in httpd-vhost.conf - ErrorLog "logs/example-app/-error.log". When i commented it, voila!Calen
Thanks, this gave me an exact error log of what i exactly butchered in the httpd-vhosts fileChamorro
for me this showed me this error: Cannot load C:/xampp/php/php7ts.dll into server: The specified module could not be found.Rhizome
C
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!

Compassion answered 11/5, 2016 at 10:57 Comment(3)
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.Surefooted
@Surefooted well, I have clearly mentioned that "If you're using Windows 7" .Compassion
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.Printery
T
24

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

Tradespeople answered 24/10, 2014 at 22:53 Comment(5)
After moving my xampp folder to another drive than c:\ apache didn't start anymore. This solution worked for me. Thanks alot! :)Evolute
I think this step is mandatory, when we download the Xampp software as a zip archive and try to start Apache server.Oswin
This is the answer for portable version (my case). Thanks for pointing it out.Instrument
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.Osprey
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.Auricular
A
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.

Arrow answered 28/8, 2017 at 17:58 Comment(2)
This was life saver. my ssl and logs file path was invalid. this helped me correct it and its working now.Mythopoeic
This allowed me to solve my issue, which was a wrong directoryInterlocutrix
I
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.

Incite answered 16/2, 2015 at 10:43 Comment(3)
Perfect! I had specified wrong directory for log files and hence it was not starting. Fixing that fix the problem!Jackdaw
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.Farnsworth
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!Inertia
C
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.

Cyrus answered 9/11, 2014 at 9:16 Comment(1)
After making skype change, apache was still not starting, so I did the mentioned VmWare change and it worked.Camelopardalis
B
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.

Butternut answered 12/10, 2015 at 15:20 Comment(0)
S
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.

Selfreproach answered 14/7, 2014 at 13:47 Comment(3)
that solved my problem, but now we stopped some services, how those services affect my networking?Gordy
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.Hypotonic
@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/…Selfreproach
D
7

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

Dannica answered 29/5, 2015 at 19:48 Comment(2)
This is the first thing must be checked! ThanksCounterchange
This should be up a the top of the answer list.Engrain
S
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 :)

Shopkeeper answered 12/4, 2021 at 12:2 Comment(0)
D
7

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)

Decorate answered 30/5, 2022 at 9:36 Comment(0)
B
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.

Burrton answered 25/10, 2015 at 5:50 Comment(0)
F
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

Faunus answered 22/2, 2021 at 12:58 Comment(0)
C
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
Customary answered 27/2, 2016 at 11:30 Comment(1)
I have been followed point 4, run setup_xampp.bat and started services (point5), all are working fine.Keratose
P
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.

Phenoxide answered 25/9, 2015 at 3:39 Comment(0)
O
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!

Orff answered 26/4, 2017 at 12:38 Comment(0)
B
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.

Bobsledding answered 24/1, 2019 at 11:21 Comment(0)
D
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.

Disobedient answered 28/8, 2019 at 17:31 Comment(0)
W
4

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

Wortman answered 16/6, 2020 at 17:31 Comment(1)
Thanks, it helps. I have an error in http-vhosts.conf file.Firecrest
M
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)

Morgan answered 18/7, 2015 at 7:5 Comment(0)
F
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 .

Freestanding answered 15/2, 2016 at 19:31 Comment(0)
A
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.

Anorexia answered 19/6, 2016 at 10:55 Comment(0)
V
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.

Versicular answered 28/12, 2016 at 9:35 Comment(0)
F
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.....
Firdausi answered 6/3, 2017 at 9:49 Comment(0)
H
2

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.

Hoy answered 16/7, 2018 at 6:51 Comment(0)
E
1

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.

Evening answered 31/1, 2014 at 19:39 Comment(0)
H
1

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

Holman answered 20/12, 2014 at 0:14 Comment(0)
F
1

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

Furbelow answered 20/5, 2015 at 14:56 Comment(0)
B
1

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

Bern answered 11/10, 2015 at 11:12 Comment(0)
Z
1

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

Zecchino answered 17/1, 2016 at 14:40 Comment(0)
M
1

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.

Molini answered 24/3, 2016 at 8:15 Comment(0)
B
1

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

Brocade answered 17/7, 2017 at 2:38 Comment(1)
This was my situation exactly and helped me nail down a silly little syntax mistake! Upvote!Petropavlovsk
L
1

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.

Lothair answered 12/12, 2019 at 17:25 Comment(0)
W
1

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.

I uninstalled and reinstalled xampp while having my antivirus disabled during installation after finishing, windows defender asked me for permission of allowing connection of apache which I allowed in private networks. So it was a firewall issue.

Woken answered 18/4, 2020 at 23:4 Comment(0)
S
1

This worked for me and I wanted to share it

If you have already created ssl for xampp by folowing the steps in this article

open C:\xampp\apache\conf\extra\httpd-xampp.conf

check SSLCertificateFile "crt/site.test/server.crt"

if site.test in httpd-xampp.conf is different, then check C:\xampp\apache\crt\#YOUR_SITE_NAME_HERE\. change site.test in httpd-xampp.conf to #YOUR_SITE_NAME_HERE

Serous answered 30/10, 2021 at 10:27 Comment(0)
C
1

I had a similar error and changing port or running as administrator didn't work. I'm on Windows 10. I ran apache_start.bat from xampp directory and I got a more specific feedback that said there was an error on my https-vhosts.conf file, specifically an extra \ at the end of a document root. Removed it, it worked again.

Calliper answered 14/6, 2022 at 6:57 Comment(0)
G
0

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.

Globular answered 14/9, 2014 at 18:51 Comment(0)
S
0

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

Schubert answered 17/3, 2016 at 23:34 Comment(0)
K
0

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.

Kier answered 16/2, 2018 at 7:24 Comment(0)
M
0

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

Marybelle answered 22/10, 2018 at 13:50 Comment(0)
U
0

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

Unique answered 11/3, 2019 at 8:54 Comment(0)
S
0

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

Senhorita answered 12/3, 2019 at 11:56 Comment(0)
P
0

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

Pilgrimage answered 17/1, 2020 at 12:26 Comment(0)
P
0

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

Promethium answered 24/6, 2020 at 9:18 Comment(0)
D
0

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.

Disoperation answered 20/1, 2021 at 7:48 Comment(0)
J
0

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.

Jochebed answered 28/1, 2021 at 13:8 Comment(0)
A
0

I tried all solutions but my problem persisted. It turns out after installing Visual Studio 2019, a lot of changes had occurred in my C++ Redistributables.

I actually run

test_php.bat

which showed me the error which was

C:\Windows\SYSTEM32\VCRUNTIME140.dll' 14.0 is not compatible with this PHP build linked with 14.28 in Unknown on line 0

I therefore proceeded to the:

Microsoft Visual Studio website --> Other Tools, Frameworks, and Redistributables --> Microsoft Visual C++ Redistributable for Visual Studio 2019

and downloaded. After installing the file and restarting my PC, problem solved. Apache now runs without errors

Abramabramo answered 7/5, 2021 at 3:39 Comment(0)
B
0

After changing your port remember to change port in config. It will simply run by "http://localhost:8081/phpmyadmin/" instead of http://localhost/phpmyadmin/

xampp

Bradwell answered 16/5, 2021 at 2:0 Comment(0)
P
0

Follow this for instant solution!

  1. This is coming either it doesn't have access to start a service to listen over PORT

Soln: Use Admin Access

  1. This is coming because already there is a port 80,443 is running on system

Soln: use netstat -ano | find "0.0.0.0:443" and then use taskkill /pid ENTER_PROCESS_ID /F to kill and restart Apache

  1. Search for backg services which are running and u don't need may be mongo, node server, etc close them

  2. If nothing works open httpd.conf and httpd-ssl.conf file and replace 443 as 4431 and 80 as 8080

  3. Nothing works may be due to problem related to files, so install XAMPP again in a location with no SPACE C:\XAMPP

!!SOLVED!!

Prebo answered 3/2, 2022 at 20:13 Comment(0)
S
0

if the above mentioned / elaborated answer is not sufficient then try this command in xampp Shell as you can watch in attached image.

   **setup_xampp.batt**

enter image description here

enter image description here

just see the port id on which xampp is stared try to access with same port..

i.e http://localhost:4040/phpmyadmin/ 127.0.0.1:4040/phpmyadmin

Seventy answered 10/5, 2023 at 13:31 Comment(1)
setup_xampp.batSeventy
S
0

I have followed every other solution mentioned in the answer but it didn't worked. Simply I downloaded 64 bit version installable file and installed in my home directory. It all worked fine.

BTW, I don't have skype or anything and all the ports are open in my system when I checked netstat.

Saltandpepper answered 10/12, 2023 at 8:12 Comment(0)
K
-1

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.

Knout answered 6/10, 2017 at 14:55 Comment(0)
B
-1

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

Bergamot answered 24/12, 2018 at 5:45 Comment(1)
This is not a solution to fixing the problem, this is avoiding the problem.Santonin

© 2022 - 2024 — McMap. All rights reserved.