home

How to change XAMPP server port?

July 8, 2009 · 34 comments

To change the XAMPP server port number:

  1. Stop the XAMPP server, if it is running already.
  2. Open the file [XAMPP Installation Folder]/apache/conf/httpd.conf.
  3. Now search for the string Listen 80 (I’m assuming that your XAMPP was using the port 80. Otherwise, just search for the string “Listen”). This is the port number which XAMPP uses. Change this 80 to any other number which you prefer.
  4. Then search for the string “ServerName” and update the port number there also.
  5. Now save and re-start XAMPP server and you are done.


Why do we need to change the port number? Because, these days, it is very common that a web developer needs to have multiple web servers running, all at the same time. For example, an XAMPP server can be used to run the local WordPress blog, while a JBoss server also needs to be up for testing a java web applications. In such scenarios, if two or more servers are trying to use the same port number, then the late comer will fail to get the port. So, it becomes necessary to change any one server’s port number to avoid the conflict.

Get professional testking CISSP training to become expert web developer! Download the latest testking 70-646 videos and testking 640-863 study guides to learn useful web applications.

Related Posts

{ 29 comments… read them below or add one }

Kumarasamy July 11, 2009 at 12:17 AM

this will work out for Apache(httpd) also.

Reply

Veera July 11, 2009 at 9:20 PM

Yes Kumar. In fact, XAMPP uses the Apache as it’s web server.

Reply

Bruce August 4, 2009 at 1:58 PM

Thanks,

I knew what I needed to do but couldn’t remember where the lines were in and in which files.

Saved me a bunch of time.

Reply

Veera August 4, 2009 at 5:29 PM

You are welcome. :)

Reply

mayday82 August 8, 2009 at 1:46 AM

tried that, did not work
still not able to start apache service

changed skype port
works fine now

Reply

Veera August 8, 2009 at 6:27 AM

it might have happened because of conflicting port numbers between skype and XAMPP.

Reply

ray August 31, 2009 at 3:28 PM

been trying all day to get apache running and all i needed to do was shutdown skype!

Reply

HtmlGifted September 21, 2009 at 6:45 PM

Hay all.. great advice for the skype didn’t realize it …….. any way.. I am trying to get my web server to be able to access from internet or just by another computer on my network.. for time being… Figured about changing ports but not sure how to access it from new port can some one help….. Like http://yoursite.com/8080 ……….. Find me on my community above to contact me.

thanks… Keep up the great tips.. guys.. really useful info.

Reply

Nagaraj February 8, 2010 at 9:35 AM

After changing the port in httpd.conf You can access the login page typing http://localhost:portNumber

http://xx.xx.xx.xxp:PortNumber (which you changed in httpd.conf eg: http://10.0.10.111:8181

Nagaraj

Reply

wole January 29, 2010 at 4:17 PM

i’ve tried that solution. but apache still uses port 80. when i click ‘status’ on the Xampp control panel and the browser refuses connection. Please respond urgently,i’m on a deadline!

Reply

Veera January 29, 2010 at 6:34 PM

@wole

Even after changing the port number as mentioned above, the XAMPP control panel usually displays Apache port as 80. but don’t worry about that. Re-start the XAMPP server and the port change will work.

Reply

santhosh February 9, 2010 at 9:33 AM

In skype select options dialog. In Advanced > connection tab, there is an option Use port 80 as … uncheck the option will solve the skype issue. Also make sure in windows the apache application is added automatically or manually to the firewall exception. What i still missing is although my apache status was ok my XAMPP messages shows wrong port. I was just searching for that..

Reply

Veera February 9, 2010 at 10:50 AM

I think even though you change the port number in XAMPP, the XAMPP control panel still shows the original port (i.e. 80). But the XAMPP Apache just works fine with the modified port.

Reply

Luis October 23, 2010 at 2:54 AM

Hey there,

I’m running XAMPP 1.7.3 on a Windows Vista Enterprise, and I just can’t get the web server being viewed from other computers on the network. When I try http://x.x.x.x/ I get “x.x.x.x server is taking too long to respond”. I have pretty much the same set up in other computer running XAMPP 1.7.2. and that ones work

The one not workings shows the path of httpd.exe file when ports are checked from the XAMPP control panel. The one working show only “SYSTEM”.

Any ideas on what could happen? Thanks in advance

Reply

Abdullah Saleem December 8, 2010 at 5:21 PM

Hi,

It’s showing Port 80, even I’ve changed it to port 8080. Actually, My Apache is not starting in Windows 7.

Reply

Veera December 9, 2010 at 11:30 AM

Hi Abdullah,

The GUI won’t change the port number even if you manually change it to 8080. But it doesn’t matter, as the server will start in 8080.

If the server not starting in 8080, then either the firewall blocks it or you may not have admin rights to start a server.

Reply

satya January 20, 2011 at 11:30 AM

thanks dear

Reply

Sven February 5, 2011 at 3:21 AM

You have to have a init file in the xampp folder. And in that something like:

#port 8080

if that’s what you want. Can’t remember the exact filename (but init.something).

It has nothing to do with the Apache (but you should set that to the same port as well).

Reply

Björn Boxstart April 22, 2011 at 9:45 PM

There is an ‘XAMPP.INI’ in the ‘..\xampp\src\xampp-control-panel\’ folder. This file contains a setting for the port number of apache. Change this number, save the file and copy it to the root of the xampp folder. Then restart the control panel and start apache. The new port number will now also be used in the control panel.

You still need to change the httpd.conf file though….

Kind regards,
Björn

Reply

Pankaj Kumar Jha July 17, 2011 at 9:50 AM

Thanks Dear,

I tried and its working fine…
Now I am using multiple servers as well as skype without any problem of port conflicting ….

Reply

John August 1, 2011 at 10:19 AM

When i first encountered this problem, i usually disable skype first then run XAMPP. But now that i have lots of programs installed on my computer, i can’t figure out which one is using the same port with XAMPP. This guide saved me as i was googling for the answer. It really helped a lot. Thank.s

Reply

skoten August 15, 2011 at 8:50 PM

Good Stuff man………….thanks

Reply

Mani August 19, 2011 at 12:29 PM

Hi Veera,
The article was good, and it is working for me.I have installed two XAMPP instances in a single machine.Modified the port for the seconcd instance at httpd.conf, but still i cannot access the new one.you have any idea on this?
Thanks

Reply

Mahesh Dahal September 20, 2011 at 4:48 PM

Thanks a Lot. It Worked

Reply

Narek October 4, 2011 at 3:01 PM

Hallo to everyone, how i can change mySQL port [3306] on XAMPP, or why mySQL could not start, port is busy… thanks…

Reply

ivan November 10, 2011 at 9:01 PM

Its work, thanks

Reply

Gunjan January 31, 2012 at 3:30 PM

Hey this really helped me out….thanx a ton for the post….

Reply

Manoj February 1, 2012 at 5:04 PM

I change As per Your Instructions But Still I am Getting error ie following
java State 0 Service 0 State 0 Thread 0 Op 0 Port 8080
Apachi Started [Port 80]

Please Anybody can help me..

That Java software i uninstalled.

Reply

Veera February 1, 2012 at 9:46 PM

Can you elaborate more on the error you are getting? I’m not able to figure out what’s going wrong with the information given in your comment/

What Java software did you uninstall? SDK?

Reply

Leave a Comment

{ 5 trackbacks }

Previous post:

Next post: