Fix XAMPP Apache Not Starting Because Port 80 In Use

xampp apache serverThe most common cause for the XAMPP Apache server not starting issue is because the default port no 80 may already be in use by another program like Skype, Teamviewer etc.  For example, in my previous blog post with the solution for XAMPP and Windows User Account Control warning message issue, Mr. Shankar Paul said his new XAMPP Apache was not working. He had got the below message from XAMPP which says the Port 80 in use by another program.

————————-
I can not start Apache because of the problem mentioned below.
I can not understand how to solve it. Any body help me, please.

3:07:06 PM [main] Initializing Control Panel
3:07:06 PM [main] Windows Version: Windows 7 Ultimate 32-bit
3:07:06 PM [main] XAMPP Version: 1.8.3
3:07:06 PM [main] Control Panel Version: 3.2.1 [ Compiled: May 7th 2013 ]
3:07:06 PM [main] You are not running with administrator rights! This will work for
3:07:06 PM [main] most application stuff but whenever you do something with services
3:07:06 PM [main] there will be a security dialogue or things will break! So think
3:07:06 PM [main] about running this application with administrator rights!
3:07:06 PM [main] XAMPP Installation Directory: “c:\xampp\”
3:07:06 PM [main] Checking for prerequisites
3:07:07 PM [main] All prerequisites found
3:07:07 PM [main] Initializing Modules
3:07:07 PM [Apache] Problem detected!
3:07:07 PM [Apache] Port 80 in use by “Unable to open process” with PID 4!
3:07:07 PM [Apache] Apache WILL NOT start without the configured ports free!
3:07:07 PM [Apache] You need to uninstall/disable/reconfigure the blocking application
3:07:07 PM [Apache] or reconfigure Apache and the Control Panel to listen on a different port
3:07:07 PM [main] Starting Check-Timer
3:07:07 PM [main] Control Panel Ready
3:08:54 PM [Apache] Problem detected!
3:08:54 PM [Apache] Port 80 in use by “Unable to open process” with PID 4!
3:08:54 PM [Apache] Apache WILL NOT start without the configured ports free!
3:08:54 PM [Apache] You need to uninstall/disable/reconfigure the blocking application
3:08:54 PM [Apache] or reconfigure Apache and the Control Panel to listen on a different port
3:08:54 PM [Apache] Attempting to start Apache app…
3:08:54 PM [Apache] Status change detected: running
3:08:56 PM [Apache] Status change detected: stopped
3:08:56 PM [Apache] Error: Apache shutdown unexpectedly.
3:08:56 PM [Apache] This may be due to a blocked port, missing dependencies,
3:08:56 PM [Apache] improper privileges, a crash, or a shutdown by another method.
3:08:56 PM [Apache] Press the Logs button to view error logs and check
3:08:56 PM [Apache] the Windows Event Viewer for more clues
3:08:56 PM [Apache] If you need more help, copy and post this
3:08:56 PM [Apache] entire log window on the forums
————————-

Solutions 1: Stop Conflicting Program And Start XAMPP Apache Server

If you carefully read this XAMPP message, you’ll see they give a solution – to uninstall/disable or reconfigure the blocking program. For example most common programs for Apache not starting is Skype. If that is the case quit/stop Skype and run Apache and see. I have also heard other programs like Teamviewer, Microsoft Internet Server etc. also use port 80 and block Apache from starting.

However this is not best solution. If today one program is blocking Apache from starting up, tomorrow another program (or even a service like windows web publishing service etc.) can use the same port and block Apache from running.

Solutions 2: Change Default Port 80,443 of XAMPP Apache Server

So, the best solution like EL.Web.ID and Geethika says, is to reconfigure the XAMPP Apache server to listen and use different port numbers. Here is how you do it:

1) First, you need to open the Apache “httpd.conf” file and configure it to use/listen on a new port no.

setup xampp apache
To open httpd.conf file, click the “Config” button next to Apache “Start” and “Admin” buttons. In the popup menu that opens, click and open httpd.conf

2) Within the httpd.conf file search for “listen”. You’ll find two rows with something like;

#Listen 12.34.56.78:80
Listen 80

Change the port no to a port no. of your choice (e.g. port 1234) like below

#Listen 12.34.56.78:1234
Listen 1234

3) Next, in the same httpd.conf file look for “ServerName localhost:” Set it to the new port no.

ServerName localhost:1234

4) Save and close the httpd.conf file.

5) Now click the Apache config button again and open the “httpd-ssl.conf” file.

6) In the httpd-ssl.conf file, look for “Listen” again. You may find:

Listen 443

Change it to listen on a new port no of your choice. Say like:

Listen 1443

7) In the same httpd-ssl.conf file find another line that says, “<VirtualHost _default_:443>”. Change this to your new port no. (like 1443)

7) Also in the same httpd-ssl.conf you can find another line defining the port no. For that look for “ServerName”. you might find something like:

ServerName www.example.com:443 or  ServerName localhost:433

Change this ServerName to your new port no.

8) Save and close the httpd-ssl.conf file.

9) Finally, there’s just one more place you should change the port no. For that, click and open the “Config” button of your XAMPP Control Panel. Then click the, “Service and Port Settings” button. Within it, click the “Apache” tab and enter and save the new port nos in the “main port” and “SSL port” boxes. Click save and close the config boxes.

That should do the trick. Now “Start” Apache and if everything goes well, your Apache server should start up.

You will also see the Apache Port/s no in the XAMPP control panel has change to the new port IDs you set 🙂

Using XAMPP Apache Server After Port No. Change

If you follow solution 2 and change the Apache port no, you will have to append the new port number to the URL when you connect to the Apache server. For example, previously if you typed localhost, you will now have to type localhost:1234.

Written by: Aksam Zarook
Aksam Zarook is a web designer, developer, online marketer and founder of Zeeron Solutions. With nearly 11 years of work and business experience he excels in web design, web development, graphic design and Internet marketing. He is also a family man with two adorable little kids and rides a motorbike.

Join Discussion Now!

200 comments on “Fix XAMPP Apache Not Starting Because Port 80 In Use

      1. You are my hero Aksam Z. You gave THE BEST SOLUTION. Since 3 days I am searching a way to get apache to work. Thanks man.

    1. Hi Piravinthb, d
      Did you get a “port in use” error message before? Because this solutions is for if you get the “port 80 in use” kind of error message. If you get no error messages then it can be due to any no of problems. If you can post more details about your situation and how you arrived at this point then maybe I or another reader here can help you.

  1. This worked great! But for some reason can’t get phpMyAdmin to work now? I keep getting a #2002 error? Do I have to change anything with this or MySQL now that I changed the localhost path for Apache?

    1. Hi Mohammad,
      If XAMPP is not working tryout installing WAMP server. WAMP package files download size is only 38 MP so much smaller than XAMPP but can do the same development work like php systems, wordpress theme dev etc. But note you might encounter the same error. So before installing quit skype, teamviewer or any other software that might be use the port 80.

  2. i have followed all the steps but it still did not help. please F1….Somebody, cos i have a deadline to meet and im way behind schedule

  3. Error: Apache shutdown unexpectedly This may be due to a blocked port, missing dependencies improper privileges, a crash, or a shutdown by another method Press the Logs button to view error logs and check the Windows Event Viewer for more clues
    If you need more help, copy and post this
    entire log window on the forums

  4. Aksam Zarook ,
    I was frsutrated but I came across your method and it worked for me. I now have everything working smoothly. God Bless you

  5. Thank you so much. I has worked for me too. You are such an awesome man. Keep up doing good. I really appreciate for your help.

  6. thank you so much. bt i can not enter “//localhost” in address bar. the problem says, “HTTP Error 404. The requested resource is not found.” please solve this problem.

  7. Object not found!

    The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

    If you think this is a server error, please contact the webmaster.

    Error 404

    localhost
    Apache/2.4.16 (Win32) OpenSSL/1.0.1p PHP/5.6.12

    #####PLEASE HELP ME BRO IN THIS THANK YOU

  8. Thank you for solution. XAMPP works perfect, but funny thing that I still getting message:
    Problem detected!
    22:03:36 [Apache] Port 80 in use by “C:\Program Files (x86)\Skype\Phone\Skype.exe” with PID 7764!
    22:03:36 [Apache] Apache WILL NOT start without the configured ports free!
    22:03:36 [Apache] You need to uninstall/disable/reconfigure the blocking application
    22:03:36 [Apache] or reconfigure Apache and the Control Panel to listen on a different port
    22:03:36 [Apache] Problem detected!
    22:03:36 [Apache] Port 443 in use by “C:\Program Files (x86)\Skype\Phone\Skype.exe” with PID 7764!
    22:03:36 [Apache] Apache WILL NOT start without the configured ports free!
    22:03:36 [Apache] You need to uninstall/disable/reconfigure the blocking application
    22:03:36 [Apache] or reconfigure Apache and the Control Panel to listen on a different port

    anything I can do about it? 🙂

  9. oh my god..thank u aksam….awesome solution..i have this xampp problem from yesterday…accidently i saw you page..and i tried the same that u have mentioned…omg it working…thank u …

  10. hi, am having the same problem with my windows server 2003. tried starting apache but it wont start changed the port of both the program using port 80 and also that of apache to a different port number, currently no program is using port 80 but it still wont start. am running a windows server 2003 enterprise edition, am confused
    please any help

  11. 6:30:02 PM [Apache] Error: Apache shutdown unexpectedly.
    6:30:02 PM [Apache] This may be due to a blocked port, missing dependencies,
    6:30:02 PM [Apache] improper privileges, a crash, or a shutdown by another method.
    6:30:02 PM [Apache] Press the Logs button to view error logs and check
    6:30:02 PM [Apache] the Windows Event Viewer for more clues
    I am getting the above error. i changed port number 80 to 82. But still i am getting same error

  12. hi tried all you said syill getting this:Error: Apache shutdown unexpectedly.
    21:56:26 [Apache] This may be due to a blocked port, missing dependencies,
    21:56:26 [Apache] improper privileges, a crash, or a shutdown by another method.
    21:56:26 [Apache] Press the Logs button to view error logs and check
    21:56:26 [Apache] the Windows Event Viewer for more clues
    21:56:26 [Apache] If you need more help, copy and post this
    21:56:26 [Apache] entire log window on the forums

  13. I have Follow the steps but when i open browser and write Localhost/ than page say ( This web page is not Available) i have change Port as well, and quit the Skype.

    Any one can solve my problems

    Thanks

  14. Have any project limit on Xampp server, I have 100+ site on xampp server, Now i am faced a problems.
    Problems is Apache and MySql working fine but “localhost/projectname” are not coming or localhost/phpmyadmin not coming.

    Any one can solve my problems

    Thanks

    1. sorry the error is this Error: Apache shutdown unexpectedly.
      3:49:10 PM [Apache] This may be due to a blocked port, missing dependencies,
      3:49:10 PM [Apache] improper privileges, a crash, or a shutdown by another method.
      3:49:10 PM [Apache] Press the Logs button to view error logs and check
      3:49:10 PM [Apache] the Windows Event Viewer for more clues
      3:49:10 PM [Apache] If you need more help, copy and post this
      3:49:10 PM [Apache] entire log window on the forums

  15. hello i have a problem with xampp when the end and finished the installation tells me these two errors :
    “port 80 or 443 ( SSL ) already in use ! Installing Apache 2.4 service failed!

    “port 3306 already in use ! Installing MySQL service failed!

    someone please know what to do ?

  16. Thanks Aksam! This has been very helpful. I’m setting up XAMPP for Codeception/Selenium/PHP use 🙂

  17. while giving 1234 in main port and ssl port as 1443 while save option it is showing error that stream write

  18. Was hoping the change of port numbers would work but now I get this message……
    18:41:15 [Apache] Attempting to start Apache app…
    18:41:15 [Apache] Status change detected: running
    18:41:16 [Apache] Status change detected: stopped
    18:41:16 [Apache] Error: Apache shutdown unexpectedly.
    18:41:16 [Apache] This may be due to a blocked port, missing dependencies,
    18:41:16 [Apache] improper privileges, a crash, or a shutdown by another method.
    18:41:16 [Apache] Press the Logs button to view error logs and check
    18:41:16 [Apache] the Windows Event Viewer for more clues
    18:41:16 [Apache] If you need more help, copy and post this
    18:41:16 [Apache] entire log window on the forums………
    anyone got an idea of what I do now. thanks

  19. Thank you! I spent about an hour on this and had already changed my default Apache port to 8080, but was still getting the error. Then I saw your article which pointed me in the direction of the XAMPP Config -> Service and Ports Settings, which I’d never noticed before! Thanks again 🙂

  20. Thank you Aksan,
    Tried severals google tips, yours did the job
    it’s working perfectly now

  21. even though doing these all still its not working
    its showing this
    12:42:10 [Apache] Status change detected: stopped
    12:42:10 [Apache] Error: Apache shutdown unexpectedly.
    12:42:10 [Apache] This may be due to a blocked port, missing dependencies,
    12:42:10 [Apache] improper privileges, a crash, or a shutdown by another method.
    12:42:10 [Apache] Press the Logs button to view error logs and check
    12:42:10 [Apache] the Windows Event Viewer for more clues
    12:42:10 [Apache] If you need more help, copy and post this
    12:42:10 [Apache] entire log window on the forums

  22. 10:57:50 PM [Apache] Error: Apache shutdown unexpectedly.
    10:57:50 PM [Apache] This may be due to a blocked port, missing dependencies,
    10:57:50 PM [Apache] improper privileges, a crash, or a shutdown by another method.
    10:57:50 PM [Apache] Press the Logs button to view error logs and check
    10:57:50 PM [Apache] the Windows Event Viewer for more clues
    10:57:50 PM [Apache] If you need more help, copy and post this
    10:57:50 PM [Apache] entire log window on the forums

    this is shown and i have tried all method now, what i have to do

  23. Hi…I have followed all your steps and now I am not getting the error message which I was getting previously. But now – ‘Attempting to start Apache app…’ this message is getting displayed and nothing happens. Apache server still does not gets started.. Can anybody help?

  24. I can get to my xampp folder on localhost, but when I try to access any other directory I have within my htdocs folder, there’s some sort of redirect taking place: so I type: localhost:1337/mydirectory, and get redirected to: localhost/mydirectory (without the port number).. which then obviously gives me nothing but a blank screen…

  25. Hi Aksam,
    Great remedy, Thank you so much.
    I have changed only my httpd.config to port 8080 in Listen and localhost lines as you suggest and everything works fine with Bitmani under Windows 10. Have NOT changed http-ssl.config and Service Setting which remain 80 and 443 respectively. Using Apache 2.4.
    I do have one concern though; could this cause an issue when uploading my website to remote host server?

    Thanks in advance,
    Rob

  26. I am using Ubuntu, I have installed XAMPP using WINE tool, gone through same steps as u mentioned. But Apache server again stopping immediately after clicking on start.

  27. I tried will all steps but still not successful 🙁 with the common error like below. Could you please give me the advise? Thanks so much.

    Error: Apache shutdown unexpectedly.
    11:48:18 PM [Apache] This may be due to a blocked port, missing dependencies,
    11:48:18 PM [Apache] improper privileges, a crash, or a shutdown by another method.
    11:48:18 PM [Apache] Press the Logs button to view error logs and check
    11:48:18 PM [Apache] the Windows Event Viewer for more clues
    11:48:18 PM [Apache] If you need more help, copy and post this
    11:48:18 PM [Apache] entire log window on the forums

  28. The best way to solve this problem is:

    1. Open a CMD prompt and type in command: net stop was /y

    2. Run Dialog Box (press keys Win+R) .. then type: services.msc

    3. Scroll down to: World Wide Web Publishing Service Double click on it and click STOP (if this service status is Started)

    4.Start Apache again with XAMPP 🙂

  29. Thank you for your clear and thorough instructions. Even I could follow them. 😉
    Apache started to work perfectly. However, I as many other replyers still have a blank page when I write http://localhost in my browser or HTTP 404 error message.

    Apache error log:
    [Mon Aug 08 14:04:16.286632 2016] [ssl:warn] [pid 1608:tid 528] AH01909: http://www.example.com:1443:0 server certificate does NOT include an ID which matches the server name
    [Mon Aug 08 14:04:16.358695 2016] [mpm_winnt:notice] [pid 1608:tid 528] AH00354: Child: Starting 150 worker threads.

    How can I pass around this ID problem? Or is the problem somewhere else?
    Please help us, struggling with this empty page syndrome!

  30. 10:57:50 PM [Apache] Error: Apache shutdown unexpectedly.
    10:57:50 PM [Apache] This may be due to a blocked port, missing dependencies,
    10:57:50 PM [Apache] improper privileges, a crash, or a shutdown by another method.
    10:57:50 PM [Apache] Press the Logs button to view error logs and check
    10:57:50 PM [Apache] the Windows Event Viewer for more clues
    10:57:50 PM [Apache] If you need more help, copy and post this
    10:57:50 PM [Apache] entire log window on the forums

  31. Thank you Zarook it work , those I jump the final step (step 9) because I didn’t see “Config” button of my XAMPP Control Panel. still it work fine for now. thank a lot

  32. [Wed Nov 02 12:04:34.147876 2016] [ssl:warn] [pid 8236:tid 544] AH01909: http://www.example.com:443:0 server certificate does NOT include an ID which matches the server name
    [Wed Nov 02 12:04:34.187941 2016] [core:warn] [pid 8236:tid 544] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten — Unclean shutdown of previous Apache run?
    [Wed Nov 02 12:04:34.287104 2016] [ssl:warn] [pid 8236:tid 544] AH01909: http://www.example.com:443:0 server certificate does NOT include an ID which matches the server name
    [Wed Nov 02 12:04:34.672737 2016] [mpm_winnt:notice] [pid 8236:tid 544] AH00455: Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/5.6.24 configured — resuming normal operations
    [Wed Nov 02 12:04:34.672737 2016] [mpm_winnt:notice] [pid 8236:tid 544] AH00456: Apache Lounge VC11 Server built: Jul 7 2016 11:13:22
    [Wed Nov 02 12:04:34.672737 2016] [core:notice] [pid 8236:tid 544] AH00094: Command line: ‘c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache’
    [Wed Nov 02 12:04:34.674739 2016] [mpm_winnt:notice] [pid 8236:tid 544] AH00418: Parent: Created child process 5032
    [Wed Nov 02 12:04:35.276726 2016] [ssl:warn] [pid 5032:tid 572] AH01909: http://www.example.com:443:0 server certificate does NOT include an ID which matches the server name
    [Wed Nov 02 12:04:35.400429 2016] [ssl:warn] [pid 5032:tid 572] AH01909: http://www.example.com:443:0 server certificate does NOT include an ID which matches the server name
    [Wed Nov 02 12:04:35.452014 2016] [mpm_winnt:notice] [pid 5032:tid 572] AH00354: Child: Starting 150 worker thread

    What Should i do?

  33. Thanks but it didn’t worked for me. I have installed visual c++ redistributable, I have changed the port number as per this article but finally my xampp not working.

  34. 18:51:43 [Apache] Error: Apache shutdown unexpectedly.
    18:51:43 [Apache] This may be due to a blocked port, missing dependencies,
    18:51:43 [Apache] improper privileges, a crash, or a shutdown by another method.
    18:51:43 [Apache] Press the Logs button to view error logs and check
    18:51:43 [Apache] the Windows Event Viewer for more clues
    18:51:43 [Apache] If you need more help, copy and post this
    18:51:43 [Apache] entire log window on the forums

  35. Thanks alot for the information, i fellowed ur instructions but it didn’t work. The point is that i use to have an old xampp server that couldn’t work with php laravel framework, so i download and install xampp 7.0.13-1 which i put in a diff directory(programs file) but the apache server can’t start and if i click on the start button it will display this: “The program can’t start because api-ms-crt-runtime-11-1-0.dll is missing from your computer”. Please, i need your help. thanks?

Leave a Reply