To change the XAMPP server port number:
- Stop the XAMPP server, if it is running already.
- Open the file [XAMPP Installation Folder]/apache/conf/httpd.conf.
- 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.
- Then search for the string “ServerName” and update the port number there also.
- 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.


{ 29 comments… read them below or add one }
this will work out for Apache(httpd) also.
Yes Kumar. In fact, XAMPP uses the Apache as it’s web server.
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.
You are welcome.
tried that, did not work
still not able to start apache service
changed skype port
works fine now
it might have happened because of conflicting port numbers between skype and XAMPP.
been trying all day to get apache running and all i needed to do was shutdown skype!
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.
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
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!
@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.
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..
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.
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
Hi,
It’s showing Port 80, even I’ve changed it to port 8080. Actually, My Apache is not starting in Windows 7.
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.
thanks dear
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).
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
Thanks Dear,
I tried and its working fine…
Now I am using multiple servers as well as skype without any problem of port conflicting ….
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
Good Stuff man………….thanks
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
Thanks a Lot. It Worked
Hallo to everyone, how i can change mySQL port [3306] on XAMPP, or why mySQL could not start, port is busy… thanks…
Its work, thanks
Hey this really helped me out….thanx a ton for the post….
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.
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?
{ 5 trackbacks }