5

I have a question related to PHP. I am .net developer. I usually work on asp.net and c#.I installed Visual Studio and SQL Server in my laptop.Now I am trying to Install Xampp server on my system. Here I getting some problem.After Installation When it check for port. It show me message port 80 or 443 aleardy in use apache server installation is failed. I Guess it is happening due to IIS installed in my system. I stopped the IIS and Installed it again But the same problem is coming again. I uninstall the Skype too for this but nothing is working for me. Please tell me why this is happening and what is the solution for this. I hope you understand what is my problem. Please help me for this

mani rajput
  • 75
  • 2
  • 2
  • 8
  • First of all find the program, that is using the port: http://stackoverflow.com/questions/1438141/how-to-get-list-of-port-which-are-in-use-at-server – user4035 Oct 17 '13 at 04:21
  • Did it work while IIS was uninstalled? You must change port for one of your servers (IIS or Apache) if you want them both running. They can't both listen to the same port. – becquerel Oct 17 '13 at 04:23
  • @becquerel how can i change the port for apache i have no idea please tell me?? – mani rajput Oct 17 '13 at 04:25
  • Do you have skype installed? – Cole Tobin Oct 17 '13 at 04:26
  • @ColeJohnson i had but i uninstalled it from my system – mani rajput Oct 17 '13 at 04:38
  • 1
    You need to edit your httpd.conf file. It should be in your xampp apache/conf folder. In short you should be able to find :80 in the file and replace it with another port. Take a look at http://forum.wampserver.com/read.php?2,13744 – becquerel Oct 17 '13 at 04:59

7 Answers7

9

Fix for this Problem:

Open up Skype and go to Tools and select Options. From the list that appears select Advanced and then Connection. There will probably be a check mark inside where it says “Use port 80 and 443 as alternatives for incoming connections” just unchecked that box and save your changes. Skype will still function normally and now XAMPP will be able to use port 80 to run.

Useful link

if you have no Skype installed

  • Locate the file httpd.conf. This file should be found in C:\xampp\apache\conf (or whichever directory you installed XAMPP.

  • Open the file using a text editor.

  • Locate the line that says Listen 80.

  • Change the port number (80) to a different number(eg. 1234).

  • Restart the Apache Server to have the change take effect. Do this
    by clicking on the Stop button on the XAMPP control panel and
    then clicking on the Start button.

  • When you connect to the Apache Server, you will have to append
    the port number to the URL, previously where you typed localhost, you will now have to type localhost:1234

Another Useful link

Ajith S
  • 2,907
  • 1
  • 18
  • 30
5

Solution 1:

Close the programs running on port 80, it may be one like SKYPE

For Command Line quit

In Windows

for /f "tokens=5" %a in ('netstat -aon ^| find ":80" ^| find "LISTENING"') do taskkill /f /pid %a

In linux just use

sudo fuser -k 80/tcp

Install wamp(win), lamp(linux) or mamp(mac).. Installation would not be failed even your ports are in use.

Solution 2:

After installation launch the program. left click the wamp icon in taskbar tray it will show a menu

=> go to apache => go to httpd.config click it to open..

Find(Ctrl+F) listen:80 and replace it with listen port_number like listen:88 or listen:96 etc.

again click on wamp icon.. click restart all services.

Your apache would be fine

Sami
  • 8,168
  • 9
  • 66
  • 99
1

There are many tools which would let you know which program is using port 80 or 443 already. But I prefer a simple command to do so. Open up a command prompt then type.

netstat -a

It will let you know which program is using port 80 and for an explanation of all options.

netstat /?

Second Part of the question to Change the Apache port. You have to change the settings in apache httpd.conf settings from:

Listen 80
ServerName localhost:80

to

Listen 8012
ServerName localhost:8012

Then try to run in web browser as http://localhost:8012

Vineet1982
  • 7,730
  • 4
  • 32
  • 67
1

Another solution without changing skype: ( for port 443 )

First, port 443 is the HTTPS default port. you need to change that on the server to something else ( ex 4433 ). But in this case , you must specify that new port every time you want to use HTTPS requests ex :

"https://localhost:4433"   .just typing "https://localhost" will NOT work. 

So to change the port , go to folder "htdocs" in the Apache server , and use something like "notepad++" to replace all :443 by :4433. These ports should be in "httpd-sni.conf" and 'httpd-ssl.conf"

I think it is ok to make the change as you are in a development environment.

1

As it says - the port 80 and 443 are already in use. It means that the ports 80 and 443 are already in use by some other server or application. When i faced this issue, it was wamp server that was using these ports(not skype in my case).

What i did to resolve this is that I changed the ports for xampp.

How:

  1. I configured the httpd.conf & httpd-ssl.conf files for Apache.
  2. I changed values for Listen 80(where 80 is the port number) to another random port number(I chose 88) in httpd.conf file.
  3. I changed values for Listen 443(where 443 is the port number) to another random port number(I chose 4433) in httpd-ssl.conf file.

Make sure you Apache server doesnt use the ports 80 and 443 anywhere in the configuration files, then it will work fluently.

Talha Imam
  • 1,046
  • 1
  • 20
  • 22
0

type:

net stop was /y

in command prompt as administrator

admin command prompt

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
0

just go to apache directory and search to find 'httpd-ssl.conf' and open it then search to find 443, you find 3, edit all of them to another number, i edit to 886. then save file and try to run apache.

Abolfazl Miadian
  • 3,099
  • 2
  • 19
  • 15