0

I am currently having problems on my XAMPP. It says that the Port 80 is being used by some other process or program. I tried looking for the program or process in my Task Manager, but I couldn't find which exactly is using the port. For the meantime, since I need to continue developing my project, I just changed the Apache port, but I don't really believe that it's the right thing to do.

Here's the error that XAMPP has been returning to me when I was using Port 80 and SSL 443

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

I've no idea what Port 80 in use by "Unable to open process" with PID 4! means. I tried looking for it, as I've said, but I couldn't find any process or program in the task manager which has the PID 4. Please someone help me, I really need this. Thank you and I'll be grateful.

EDIT:

netstat -np TCP | find "80" command returned a list like this

TCP 127.0.0.1:1110        127.0.0.1:51480      TIME_WAIT 
TCP 192.168.1.3:51032     108.160.162.110:80   ESTABLISHED 
TCP 192.168.1.3:51104     173.194.127.37:80    ESTABLISHED 
TCP 192.168.1.3:51221      74.125.128.95:80    ESTABLISHED 
TCP 192.168.1.3:51226     120.28.35.33:80      ESTABLISHED 
TCP 192.168.1.3:51402      66.29.212.73:80     ESTABLISHED 
TCP 192.168.1.3:51406      74.125.128.156:80   ESTABLISHED 

What do I do next?

Additional:

I tried netstat -aon. Here's the result:

Active Connections

  Proto  Local Address          Foreign Address        State           PID
  TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       4
  TCP    0.0.0.0:81             0.0.0.0:0              LISTENING       1468
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       548
  TCP    0.0.0.0:444            0.0.0.0:0              LISTENING       1468
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4
  TCP    0.0.0.0:554            0.0.0.0:0              LISTENING       3168
  TCP    0.0.0.0:1110           0.0.0.0:0              LISTENING       1944
  TCP    0.0.0.0:2869           0.0.0.0:0              LISTENING       4
  TCP    0.0.0.0:3306           0.0.0.0:0              LISTENING       7624
  TCP    0.0.0.0:5357           0.0.0.0:0              LISTENING       4
  TCP    0.0.0.0:10243          0.0.0.0:0              LISTENING       4
  TCP    0.0.0.0:49152          0.0.0.0:0              LISTENING       764
  TCP    0.0.0.0:49153          0.0.0.0:0              LISTENING       920
  TCP    0.0.0.0:49154          0.0.0.0:0              LISTENING       124
  TCP    0.0.0.0:49156          0.0.0.0:0              LISTENING       872
  TCP    0.0.0.0:49157          0.0.0.0:0              LISTENING       864
  TCP    127.0.0.1:1110         127.0.0.1:51031        ESTABLISHED     1944
  TCP    127.0.0.1:1110         127.0.0.1:51785        ESTABLISHED     1944
  TCP    127.0.0.1:1110         127.0.0.1:52762        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:52780        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:52823        ESTABLISHED     1944
  TCP    127.0.0.1:1110         127.0.0.1:52829        ESTABLISHED     1944
  TCP    127.0.0.1:1110         127.0.0.1:52839        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:52841        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:52845        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:52847        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:52852        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:52855        ESTABLISHED     1944
  TCP    127.0.0.1:1110         127.0.0.1:52884        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:52886        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:52902        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:52904        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:52906        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:52909        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:52911        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:52913        CLOSE_WAIT      1944
  TCP    127.0.0.1:3306         127.0.0.1:51127        ESTABLISHED     7624
  TCP    127.0.0.1:3306         127.0.0.1:51945        ESTABLISHED     7624
  TCP    127.0.0.1:3306         127.0.0.1:51949        ESTABLISHED     7624
  TCP    127.0.0.1:3306         127.0.0.1:52009        ESTABLISHED     7624
  TCP    127.0.0.1:3306         127.0.0.1:52398        ESTABLISHED     7624
  TCP    127.0.0.1:3306         127.0.0.1:52400        ESTABLISHED     7624
  TCP    127.0.0.1:5354         0.0.0.0:0              LISTENING       1976
  TCP    127.0.0.1:5354         127.0.0.1:49155        ESTABLISHED     1976
  TCP    127.0.0.1:27015        0.0.0.0:0              LISTENING       1908
  TCP    127.0.0.1:27015        127.0.0.1:49195        ESTABLISHED     1908
  TCP    127.0.0.1:49155        127.0.0.1:5354         ESTABLISHED     1908
  TCP    127.0.0.1:49195        127.0.0.1:27015        ESTABLISHED     4508
  TCP    127.0.0.1:50796        0.0.0.0:0              LISTENING       7800
  TCP    127.0.0.1:51031        127.0.0.1:1110         ESTABLISHED     4172
  TCP    127.0.0.1:51127        127.0.0.1:3306         ESTABLISHED     7776
  TCP    127.0.0.1:51785        127.0.0.1:1110         ESTABLISHED     4560
  TCP    127.0.0.1:51945        127.0.0.1:3306         ESTABLISHED     7776
  TCP    127.0.0.1:51949        127.0.0.1:3306         ESTABLISHED     7776
  TCP    127.0.0.1:52009        127.0.0.1:3306         ESTABLISHED     7776
  TCP    127.0.0.1:52398        127.0.0.1:3306         ESTABLISHED     7776
  TCP    127.0.0.1:52400        127.0.0.1:3306         ESTABLISHED     7776
  TCP    127.0.0.1:52784        127.0.0.1:1110         TIME_WAIT       0
  TCP    127.0.0.1:52823        127.0.0.1:1110         ESTABLISHED     4560
  TCP    127.0.0.1:52829        127.0.0.1:1110         ESTABLISHED     4560
  TCP    127.0.0.1:52855        127.0.0.1:1110         ESTABLISHED     4560
  TCP    127.0.0.1:52872        127.0.0.1:1110         TIME_WAIT       0
  TCP    127.0.0.1:52913        127.0.0.1:1110         FIN_WAIT_2      4560
  TCP    192.168.1.3:139        0.0.0.0:0              LISTENING       4
  TCP    192.168.1.3:51032      108.160.162.110:80     ESTABLISHED     1944
  TCP    192.168.1.3:51786      69.171.248.16:443      ESTABLISHED     1944
  TCP    192.168.1.3:52824      31.13.68.16:443        ESTABLISHED     1944
  TCP    192.168.1.3:52831      74.125.128.95:80       ESTABLISHED     1944
  TCP    192.168.1.3:52858      173.194.127.37:80      ESTABLISHED     1944
  TCP    192.168.1.3:52908      27.111.185.144:443     TIME_WAIT       0
  TCP    192.168.1.3:52914      198.252.206.16:80      FIN_WAIT_2      1944
  TCP    [::]:80                [::]:0                 LISTENING       4
  TCP    [::]:81                [::]:0                 LISTENING       1468
  TCP    [::]:135               [::]:0                 LISTENING       548
  TCP    [::]:444               [::]:0                 LISTENING       1468
  TCP    [::]:445               [::]:0                 LISTENING       4
  TCP    [::]:554               [::]:0                 LISTENING       3168
  TCP    [::]:1110              [::]:0                 LISTENING       1944
  TCP    [::]:2869              [::]:0                 LISTENING       4
  TCP    [::]:3587              [::]:0                 LISTENING       4904
  TCP    [::]:5357              [::]:0                 LISTENING       4
  TCP    [::]:10243             [::]:0                 LISTENING       4
  TCP    [::]:49152             [::]:0                 LISTENING       764
  TCP    [::]:49153             [::]:0                 LISTENING       920
  TCP    [::]:49154             [::]:0                 LISTENING       124
  TCP    [::]:49156             [::]:0                 LISTENING       872
  TCP    [::]:49157             [::]:0                 LISTENING       864
  UDP    0.0.0.0:500            *:*                                    124
  UDP    0.0.0.0:3544           *:*                                    124
  UDP    0.0.0.0:3702           *:*                                    1048
  UDP    0.0.0.0:3702           *:*                                    1064
  UDP    0.0.0.0:3702           *:*                                    1048
  UDP    0.0.0.0:3702           *:*                                    3560
  UDP    0.0.0.0:3702           *:*                                    1064
  UDP    0.0.0.0:3702           *:*                                    3560
  UDP    0.0.0.0:4500           *:*                                    124
  UDP    0.0.0.0:5004           *:*                                    3168
  UDP    0.0.0.0:5005           *:*                                    3168
  UDP    0.0.0.0:5355           *:*                                    1328
  UDP    0.0.0.0:49154          *:*                                    1976
  UDP    0.0.0.0:59056          *:*                                    1048
  UDP    0.0.0.0:59058          *:*                                    1064
  UDP    0.0.0.0:60910          *:*                                    3560
  UDP    127.0.0.1:1233         *:*                                    7048
  UDP    127.0.0.1:1900         *:*                                    3560
  UDP    127.0.0.1:49152        *:*                                    1908
  UDP    127.0.0.1:49153        *:*                                    1908
  UDP    127.0.0.1:49169        *:*                                    4508
  UDP    127.0.0.1:49170        *:*                                    4508
  UDP    127.0.0.1:51245        *:*                                    3560
  UDP    127.0.0.1:64663        *:*                                    4560
  UDP    192.168.1.3:137        *:*                                    4
  UDP    192.168.1.3:138        *:*                                    4
  UDP    192.168.1.3:1900       *:*                                    3560
  UDP    192.168.1.3:5353       *:*                                    1976
  UDP    192.168.1.3:51244      *:*                                    3560
  UDP    192.168.1.3:62356      *:*                                    124
  UDP    [::]:500               *:*                                    124
  UDP    [::]:3540              *:*                                    4904
  UDP    [::]:3702              *:*                                    1064
  UDP    [::]:3702              *:*                                    1064
  UDP    [::]:3702              *:*                                    3560
  UDP    [::]:3702              *:*                                    1048
  UDP    [::]:3702              *:*                                    3560
  UDP    [::]:3702              *:*                                    1048
  UDP    [::]:4500              *:*                                    124
  UDP    [::]:5004              *:*                                    3168
  UDP    [::]:5005              *:*                                    3168
  UDP    [::]:5355              *:*                                    1328
  UDP    [::]:49155             *:*                                    1976
  UDP    [::]:59057             *:*                                    1048
  UDP    [::]:59059             *:*                                    1064
  UDP    [::]:60911             *:*                                    3560
  UDP    [::1]:1900             *:*                                    3560
  UDP    [::1]:5353             *:*                                    1976
  UDP    [::1]:51243            *:*                                    3560
  UDP    [fe80::99d4:6002:6b3a:4842%17]:546  *:*                        920
  UDP    [fe80::99d4:6002:6b3a:4842%17]:1900  *:*                      3560
  UDP    [fe80::99d4:6002:6b3a:4842%17]:51242  *:*                     3560

FIX

So I was working last night on a MS VS project. I encountered errors (very unrelated to this topic) that required me to turn on the .NET Framework 3.5 on the windows features. Turns out it was the culprit. I just turned it off since I no longer need it, and boom, port 80 has been freed.

This is a very, very isolated case, but someday, this thread might help someone. So good luck guys! Thank you to everyone who answered. I really appreciate it. Thanks again!

christianleroy
  • 984
  • 4
  • 21
  • 36
  • 4
    Do you have skype installed? https://support.skype.com/en/faq/FA148/which-ports-need-to-be-open-to-use-skype-for-windows-desktop – Ben Fortune Aug 19 '13 at 10:26
  • No. The last program(s) I've installed before this error begun was the MS SQL Database Engine, and some other MS programs. – christianleroy Aug 19 '13 at 10:28
  • yes..if skype is running then xampp will not start apache service –  Aug 19 '13 at 10:29
  • Try `netstat -np TCP | find "80"` in a command line. – Ben Fortune Aug 19 '13 at 10:30
  • The command returned a list like this TCP 127.0.0.1:1110 127.0.0.1:51480 TIME_WAIT TCP 192.168.1.3:51032 108.160.162.110:80 ESTABLISHED TCP 192.168.1.3:51104 173.194.127.37:80 ESTABLISHED TCP 192.168.1.3:51221 74.125.128.95:80 ESTABLISHED TCP 192.168.1.3:51226 120.28.35.33:80 ESTABLISHED TCP 192.168.1.3:51402 66.29.212.73:80 ESTABLISHED TCP 192.168.1.3:51406 74.125.128.156:80 ESTABLISHED What do I do next? – christianleroy Aug 19 '13 at 10:35
  • Who greets you if you launch `http://localhost` in your browser? – Álvaro González Aug 19 '13 at 10:59
  • Nothing. It appears as if the link is broken. – christianleroy Aug 19 '13 at 11:01
  • @ChristianCastillo Well that showed that NOTHING was using port 80! Locally on your PC. – RiggsFolly Aug 19 '13 at 11:20
  • @ChristianCastillo Try just a `netstat -aon` on its own and add the result of that to your question. – RiggsFolly Aug 19 '13 at 11:27
  • @ChristianCastillo Well according to that both port 80 and 445, the ports used by Webservers are being used by PID 4. I think its got to be IIS and or associated bits of software, like `Web Deploy` and or `MS Sql Server Reporting service`. Especially if you are running Windows8 – RiggsFolly Aug 19 '13 at 11:42
  • @RiggsFolly Yesterday, I activated the .NET Framework 3.5 feature when I was working on a MS VS project. It probably started the error. Can I reconfigure it to another port? – christianleroy Aug 19 '13 at 11:47
  • @ChristianCastillo .NET probably didnt cause the problem but MS VS may have. Simplest solution is to `disable` the IIS service(s) until you need them via the services control panel. – RiggsFolly Aug 19 '13 at 11:51
  • @RiggsFolly Thank you very much for the help. I've fixed it now. Turns out it actually was the activation of .NET 3.5 that caused the problem. My Apache is now running back again on Port 80. It actually makes sense since I never actually did any change on my IIS. – christianleroy Aug 19 '13 at 12:12

11 Answers11

3

You are correct its always best to keep apache on 80.

Try these commands to see which process is using port 80

netstat -aon | find "0:80"

this will produce something like this

Proto  Local Address          Foreign Address        State           PID
TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       864
TCP    192.168.2.11:50122     213.248.117.50:80      TIME_WAIT       0

So here PID 864 is using port 80, from Local Address column

Then do

 tasklist /fi "PID eq 864"

This will tell you that, in my case https.exe is using port 80 but yours will be different.

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
httpd.exe                      864 Services                   0     14,236 K

You now need to remove or re-configure whatever it is on your system that is reported as using 80.

RiggsFolly
  • 83,545
  • 20
  • 96
  • 136
  • The `Image Name` is System. How do I reconfigure it? This is really killing me haha. This is what it actually returned `Image Name PID Session Name Session# Mem Usage ========================= ======== ================ =========== ============ System 4 Services 0 1,444 K (Sorry IDK how to use break lines in comments) – christianleroy Aug 19 '13 at 11:04
  • 2
    Ok this is a guess, so dont beet me up for it. If its reporting `System` I would bet its a Microsoft product so... Do you have IIS installed? – RiggsFolly Aug 19 '13 at 11:11
  • @ChristianCastillo Silly question... Have you restarted the computer? It's weird that you have a piece of software that's using port 80 but doesn't answer HTTP requests... – Álvaro González Aug 19 '13 at 11:12
  • @ChristianCastillo You don't normally use comments to provide code samples. You can just edit your question if you want to provide further details. – Álvaro González Aug 19 '13 at 11:15
  • @ÁlvaroG.Vicario I did it for him, now you have your names in a row. – RiggsFolly Aug 19 '13 at 11:17
  • I've restarted my computer several times. It's a mystery, really, what actually is using the port 80. About the IIS thing, I'm not sure. I've searched for it in the task manager, but I couldn't find it. – christianleroy Aug 19 '13 at 11:32
  • Look for it in `Control Panel -> Programs and Features -> Turn Windows features on and off – RiggsFolly Aug 19 '13 at 11:38
  • O, I remember, one of the last things I did yesterday before this error met me today was that I activated the .NET Framework 3.5 feature! Could that have caused this error? – christianleroy Aug 19 '13 at 11:40
2

very easy see following video :

http://youtu.be/c1m56HZRwuk

only thing you have to do is change

httpd.conf

Listen 80 to 8080

ServerName : localhost:80 to 8080

and

C:\xampp\apache\conf\extra

httpd-ssl.conf

Listen 443 to 4499

and

VirtualHost default:443 to 4499

ServerName www.example.com:443 to 4499

devthilan
  • 21
  • 1
1

this error message means, that another program you've actually running is already using port 80.

I'd suggest that you config your XAMPP to use Port 8080 or something like this for your local environment.

Maybe this link can help you. Or here a youtube howto: http://www.youtube.com/watch?v=-DWZ6Ecjl6I

Community
  • 1
  • 1
Jurik
  • 3,096
  • 1
  • 24
  • 49
  • I temporarily changed the port for the meantime to get it to work. I've also searched for the program that is using PID 4, but I couldn't find it. It's already working, but I've been told it isn't really the solution. But anyways, thanks for the answer. – christianleroy Aug 19 '13 at 10:41
  • This solution helped me solve the problem. I changed the apache to listen on port `8080` by changing in `httpd.conf` file. – rogcg Feb 09 '14 at 17:28
1

Open your task manager and set it to show the PID column.

papkass
  • 1,173
  • 2
  • 13
  • 19
  • I already did that, but there's no such "PID 4" in my task manager. I read somewhere that it might mean that a process is using "PID 4" rather than a program. But what do I really know. Been trying to solve this for a while now. – christianleroy Aug 19 '13 at 10:43
  • Do you have IIS installed? – papkass Aug 19 '13 at 11:47
1

Just got same error as yours... xampp was working perfectly after updating windows i have installed the IIS. By then xampp stopped. I have uninstalled the IIS as i don't need it. It fixed my issue straight away.

I have read your comments you too have updated windows components... i think there is some conflicts for ports. You can run xampp and IIS side by side if you need both just change the ports. Help link is here.

good luck!

Aamir Shahzad
  • 5,940
  • 8
  • 43
  • 62
0

you have your cloud server configured correctly? I have several private instantaneous messaging app and always use port 5222, make sure that your server is ready to listen for here, besides having well set to range names that you must enter.

Delari Jesus
  • 389
  • 4
  • 21
  • I don't think I have a cloud server, unless there is something installed by default that I am not aware about. Sorry, I don't know much about cloud servers. – christianleroy Aug 19 '13 at 10:42
0

Have you tried netstat /a /b

That should show you the process names to be looking for

bmgh1985
  • 780
  • 1
  • 13
  • 36
0

I had a similar problem "Port 80 in use by "Unable to open process" with PID 4!" The reason was because SQL server reporting services was using port 80. I stopped it and i was sorted

0

Same problem here, "Port 80 in use by "Unable to open process" with PID 4", and solved it by turning off the IIS service (from Control Panel -> Programs and Features -> Turn Windows features on or off, and then deselecting "Internet Information Services").

nyuen
  • 8,401
  • 2
  • 18
  • 28
0

go to control panel and set view by to large icons click on administrative tools and execute services and find web development agent services and stop it

0

I think the best way to install XAMPP is to do the following:

  1. Download XAMPP to C:\XAMPP
  2. Do not try to change ports of other contending programs like IIS, SKYPE, Oracle, MariaDB, SQL Server Reporting Services etc if you have them on your computer.
  3. Make changes to the httpd.config file in bin/apache
  4. Start the apache service from Windows services. er Your XAMPP control panel may still show errors

but your server will be working.

More details are here:

http://hodentekhelp.blogspot.com/2014/02/on-installing-apache-on-windows-7-64bit.html

user2063329
  • 375
  • 1
  • 4
  • 12