XAMPP Port 80 in use by "Unable to open process" with PID 4

270,102

Solution 1

Simply set Apache to listen on a different port. This can be done by clicking on the "Config" button on the same line as the "Apache" module, select the "httpd.conf" file in the dropdown, then change the "Listen 80" line to "Listen 8080". Save the file and close it.

Now it avoids Port 80 and uses Port 8080 instead without issue. The only additional thing you need to do is make sure to put localhost:8080 in the browser so the browser knows to look on Port 8080. Otherwise it defaults to Port 80 and won't find your local site.

Solution 2

So I have faced the same problem when trying to start apache service and I would like to share my solutions with you. Here is some notes about services or programs that may use port 80:

  1. Skype: skype uses port 80/443 by default. You can change this from tools->options-> advanced->connections and disable checkbox "use port 80 and 443 for addtional incoming connections".
  2. IIS: IIS uses port 80 be default so you need to shut down it. You can use the following two commands net stop w3svc net stop iisadmin
  3. SQL Server Reporting Service: You need to stop this service because it may take port 80 if IIS is not running. Go to local services and stop it.

These options work great with me and I can start apache service without errors.

The other option is to change apache listen port from httpd.conf and set another port number.

Hope this solution helps anyone who face the same problem again.

Solution 3

Your port 80 is being used by the system.

  1. In Windows “World Wide Publishing" Service is using this port and it's process is system which PID is 4 maximum time and stopping this service(“World Wide Publishing") will free the port 80 and you can connect Apache using this port. To stop the service go to the “Task manager –> Services tab”, right click the “World Wide Publishing Service” and stop.
  2. If you don't find there then Then go to "Run > services.msc" and again find there and right click the “World Wide Publishing Service” and stop.
  3. If you didn't find “World Wide Publishing Service” there then go to "Run>>resmon.exe>> Network Tab>>Listening Ports" and see which process is using port 80

enter image description here

And from "Overview>>CPU" just Right click on that process and click "End Process Tree". If that process is system that might be a critical issue.

Solution 4

I had the following error message Port 80 in use by "Unable to open process" with PID 4! Apache WILL NOT start without the configured ports free! You need to uninstall/disable/reconfigure the blocking application or reconfigure Apache and the Control Panel to listen on a different port Starting Check-Timer Control Panel Ready

opened the httpd.conf and changed the listen port from 80 to 1234 in both places

Listen 12.34.56.78:1234

Listen 1234

Then go to Config for the xampp control panel and go to service and port setting and changed the port from 80 to 1234

That worked.

Share:
270,102

Related videos on Youtube

Dave Cribbs
Author by

Dave Cribbs

I am currently going to college to become a programmer #iMaNoob :P

Updated on July 09, 2022

Comments

  • Dave Cribbs
    Dave Cribbs almost 2 years

    XAMPP won't work it says

    Port 80 in use by "Unable to open process" with PID 4!
    6:32:24 PM  [Apache]    Apache WILL NOT start without the configured ports free!
    6:32:24 PM  [Apache]    You need to uninstall/disable/reconfigure the blocking application
    6:32:24 PM  [Apache]    or reconfigure Apache and the Control Panel to listen on a different port
    

    I have tried everything from deleting the World Wide Web Publishing Service (which did not work because i dont even have it installed.) To using the command prompt which says

    Active Connections
    
      Proto  Local Address          Foreign Address        State           PID
      TCP    0.0.0.0:80             Dave:0                 LISTENING       4
      TCP    0.0.0.0:135            Dave:0                 LISTENING       776
      TCP    0.0.0.0:445            Dave:0                 LISTENING       4
      TCP    0.0.0.0:2382           Dave:0                 LISTENING       2576
      TCP    0.0.0.0:5357           Dave:0                 LISTENING       4
      TCP    0.0.0.0:49152          Dave:0                 LISTENING       548
      TCP    0.0.0.0:49153          Dave:0                 LISTENING       928
      TCP    0.0.0.0:49154          Dave:0                 LISTENING       972
      TCP    0.0.0.0:49155          Dave:0                 LISTENING       1264
      TCP    0.0.0.0:49156          Dave:0                 LISTENING       660
      TCP    0.0.0.0:49157          Dave:0                 LISTENING       1832
      TCP    0.0.0.0:49159          Dave:0                 LISTENING       652
      TCP    0.0.0.0:51782          Dave:0                 LISTENING       1884
      TCP    127.0.0.1:51783        Dave:0                 LISTENING       1884
      TCP    192.168.0.16:139       Dave:0                 LISTENING       4
      TCP    192.168.0.16:50260     stackoverflow:https    ESTABLISHED     5768
      TCP    192.168.0.16:50263     ec2-54-237-50-81:https  ESTABLISHED     5768
      TCP    192.168.0.16:50287     bn1wns1011221:https    ESTABLISHED     1640
      TCP    192.168.0.16:50456     bn1wns2011310:https    ESTABLISHED     1640
      TCP    192.168.0.16:50489     stackoverflow:http     ESTABLISHED     5768
    

    I dont understand why its not working because it was working fine a couple days ago could someone help please, thanks.When i do netstat -a -b it says this.

    Microsoft Windows [Version 6.3.9600]
    (c) 2013 Microsoft Corporation. All rights reserved.
    
    C:\WINDOWS\system32>netstat -a -b
    
    Active Connections
    
      Proto  Local Address          Foreign Address        State
      TCP    0.0.0.0:80             Dave:0                 LISTENING
     Can not obtain ownership information
      TCP    0.0.0.0:82             Dave:0                 LISTENING
     [httpd.exe]
      TCP    0.0.0.0:135            Dave:0                 LISTENING
      RpcSs
     [svchost.exe]
      TCP    0.0.0.0:443            Dave:0                 LISTENING
     [httpd.exe]
      TCP    0.0.0.0:445            Dave:0                 LISTENING
     Can not obtain ownership information
      TCP    0.0.0.0:2382           Dave:0                 LISTENING
     [sqlbrowser.exe]
      TCP    0.0.0.0:3306           Dave:0                 LISTENING
     [mysqld.exe]
      TCP    0.0.0.0:3306           Dave:0                 LISTENING
     [mysqld.exe]
      TCP    0.0.0.0:5357           Dave:0                 LISTENING
     Can not obtain ownership information
      TCP    0.0.0.0:49152          Dave:0                 LISTENING
     [wininit.exe]
      TCP    0.0.0.0:49153          Dave:0                 LISTENING
      EventLog
     [svchost.exe]
      TCP    0.0.0.0:49154          Dave:0                 LISTENING
      Schedule
     [svchost.exe]
      TCP    0.0.0.0:49155          Dave:0                 LISTENING
     [spoolsv.exe]
      TCP    0.0.0.0:49156          Dave:0                 LISTENING
     [lsass.exe]
      TCP    0.0.0.0:49157          Dave:0                 LISTENING
     [msmdsrv.exe]
      TCP    0.0.0.0:49159          Dave:0                 LISTENING
     Can not obtain ownership information
      TCP    0.0.0.0:51782          Dave:0                 LISTENING
     [sqlservr.exe]
      TCP    127.0.0.1:51783        Dave:0                 LISTENING
     [sqlservr.exe]
      TCP    192.168.0.16:139       Dave:0                 LISTENING
     Can not obtain ownership information
      TCP    192.168.0.16:49180     bn1wns2011302:https    ESTABLISHED
     [Explorer.EXE]
      TCP    192.168.0.16:49267     ec2-54-80-62-105:https  ESTABLISHED
     [opera.exe]
      TCP    192.168.0.16:49318     bn1wns2011304:https    ESTABLISHED
     [Explorer.EXE]
      TCP    192.168.0.16:49397     ord08s08-in-f14:http   ESTABLISHED
     [opera.exe]
      TCP    192.168.0.16:49417     ord08s08-in-f14:http   ESTABLISHED
     [opera.exe]
      TCP    192.168.0.16:49418     ord08s09-in-f5:http    ESTABLISHED
     [opera.exe]
      TCP    192.168.0.16:49427     static-acs-24-101-16-41:http  TIME_WAIT
      TCP    192.168.0.16:49428     static-acs-24-101-16-24:http  TIME_WAIT
      TCP    192.168.0.16:49429     static-acs-24-101-16-41:http  TIME_WAIT
      TCP    192.168.0.16:49430     static-acs-24-101-16-41:http  TIME_WAIT
      TCP    192.168.0.16:49431     static-acs-24-101-16-41:http  TIME_WAIT
      TCP    192.168.0.16:49432     ord08s08-in-f2:http    ESTABLISHED
     [opera.exe]
      TCP    192.168.0.16:49434     ord08s08-in-f5:http    ESTABLISHED
     [opera.exe]
      TCP    192.168.0.16:49435     ord08s08-in-f5:http    ESTABLISHED
     [opera.exe]
      TCP    192.168.0.16:49436     ord08s08-in-f5:http    ESTABLISHED
     [opera.exe]
      TCP    192.168.0.16:49437     ord08s08-in-f5:http    ESTABLISHED
     [opera.exe]
      TCP    192.168.0.16:49438     ord08s08-in-f5:http    ESTABLISHED
     [opera.exe]
    
    • Lawrence Cherone
      Lawrence Cherone about 10 years
      What's netstat -a -b show thats listening on port 80? Basically you got some other prog listening...skype?
    • Jason OOO
      Jason OOO about 10 years
      - restart your PC, run xamp as administrator, install PHP and MySQL as service.
    • Dave Cribbs
      Dave Cribbs about 10 years
      @JasonOOO it still says this 7:10:22 PM [Apache] Problem detected! 7:10:22 PM [Apache] Port 80 in use by "Unable to open process" with PID 4! 7:10:22 PM [Apache] Apache WILL NOT start without the configured ports free! 7:10:22 PM [Apache] You need to uninstall/disable/reconfigure the blocking application 7:10:22 PM [Apache] or reconfigure Apache and the Control Panel to listen on a different port 7:10:22 PM [Apache] Attempting to start Apache service...
    • Dave Cribbs
      Dave Cribbs about 10 years
      @LozCherone its says "the requested operation requires elevation"... what does that mean?
    • Jason OOO
      Jason OOO about 10 years
      @DaveCribbs: it means you need more privilege
  • Kevin
    Kevin over 8 years
    directly ending the process in the resource monitor works, some of the process here are not listed in the task manager. +1
  • Muhammad Ashikuzzaman
    Muhammad Ashikuzzaman over 8 years
    Means? Tell me briefly :)
  • Kevin
    Kevin over 8 years
    the xampp control panel specified that port 443 was used by PID4544 so apache can't start. so i opened task manager but it wasn't shown on the processes tab, i just stumbled upon this answer (used the resource monitor, end process and stuff) and worked. thus the upvote. good day!
  • Barrosy
    Barrosy about 8 years
    What if that process is indeed system, what should I do?
  • VirusEcks
    VirusEcks almost 8 years
    another service that uses that port is secure tunneling (vpn ssl)
  • Muhammad Ashikuzzaman
    Muhammad Ashikuzzaman almost 8 years
    @VirusEcks thanks for nice info. I will try to update my answer in shaa Allah. : )
  • kim de castro
    kim de castro over 7 years
    also change the CONFIG -> service and port settings -> change it to 8080
  • M0CH1R0N
    M0CH1R0N over 7 years
    Nice one Kim. I forgot to change these settings and kept getting the error although it did work. Thanks.
  • Jahmic
    Jahmic over 7 years
    The nice thing about this, is you don't have to defer to using another port, such as 8080 and then needing to add :8080 to all your requests.
  • Mickael Bergeron Néron
    Mickael Bergeron Néron about 7 years
    This is the answer that helped me when I first installed XAMPP 2 or 3 years ago (I know because I still see my upvote) and it still helped me today as I installed a newer version of XAMPP. Thank you so much.
  • Tom
    Tom almost 7 years
    "SQL Server Reporting Service" was it on my machine!
  • ramya
    ramya almost 7 years
    "SQL Server Reporting Service" was causing issues in my system, after stopping it, Apache started working fine.
  • Juned Ansari
    Juned Ansari almost 7 years
    Best Answer, thanks brother
  • Hafiz Shehbaz Ali
    Hafiz Shehbaz Ali over 6 years
    SQL Server Reporting was running. I want both running what to do. Can I change the SQL Reporting port in anyway?
  • Sumanstm21
    Sumanstm21 almost 6 years
    upon changing my port should i use localhost or Localhost:1234?
  • Pratik Butani
    Pratik Butani almost 5 years
    Where is CONFIG? @kimdecastro
  • khalid J-A
    khalid J-A over 4 years
    SQL Server Reporting Service solved my life
  • Moeez
    Moeez about 2 years
    @kimdecastro from where ?
  • Moeez
    Moeez about 2 years
    @M0CH1R0N where is the config ?
  • Kavya Hanumantharaju
    Kavya Hanumantharaju about 2 years
    When you open the xampp control panel top right you have config button, on click of that you have port and service settings button on click of that you will be asked to change port numbers, after changing in files you need to change the port and ssl port here also else it wont work