Apache is not running from XAMPP Control Panel

How to Change the Apache Port in XAMPP

These instructions are for XAMPP 1.7.3 running on Windows XP.
They should be similar for other configuration combinations, but no guarantee is made.
These instructions should also work for an Apache Server install that is not part of a XAMPP install (specific details regarding file locations and restarting of the Apache Server will differ).
NOTE: XAMPP 1.7.4 and XAMPP 1.7.7 display misleading port information in the XAMPP Control Panel.
Regardless of which port you specify Apache to listen to, the XAMPP Control Panel will always display:
Apache started [Port 80]
This is WRONG!!!! This is a HARDCODED string in XAMPP 1.7.4 and 1.7.7. It does not reflect the actual port Apache is listening to.
Yet another reason why you should not be using XAMPP 1.7.4 or 1.7.7.
By default, Apache Server listens on port 80, but this can be changed.

Why Change the Port?

Perhaps certain ports are blocked by your network admin or ISP (although, I would not recommend running XAMPP as a publicly accessible server).
Perhaps port 80 is already being used by some other application (like IIS, Skype, Kaspersky) and you don’t want to or are not allowed to shut it down or change it.
Apache Server is not starting and you are using XAMPP 1.7.4 (I recommend XAMPP 1.7.3). XAMPP 1.7.4 removed a useful port debugging tool, so changing the Apache Server port is one way of checking to see if you have a port conflict – change the port and if Apache Server starts working, then you know some other application is using port 80. You should try several ports, just in case you are lucky and manage to pick ports used by other applications. Some ports to try are 2375, 4173, 5107, 9260, 20010 – these ports, among others, are all listed as unassigned (but that doesn’t mean someone else isn’t using them).

How to Change the Port

Edit the httpd.conf file to change the port Apache listens on.
(1) Locate the file httpd.conf. This file should be found in C:\xampp\apache\conf (or whichever directory you installed XAMPP in – mine is on my D-drive because that is where I installed XAMPP).
(2) Open the file using a text editor or programmer’s editor (I use notepad++). DO NOT use a word processor (like Word) to open the file, it will badly mess it up.
(3a) Locate the line that says Listen 80. It is line #47 in the XAMPP 1.7.3 install.
(3b) Change the port number (80) to a different number (for this tutorial, I changed it to 1234).
(3c) Save the file.

WSASocket failed to open the inherited socket



            The very simple solution is to uncheck the “Enable LMHOSTS Lookup” box in the TCP/IP protocol setup (under WINS setting). Here are the steps to do this:



Open “Control Panel” then “Network Connections.”

Right-click on “Local Area Connection” and select “Properties.”

Double-click on the “Internet Protocol (TCP/IP)” line to open the “Properties.”

On the “General” tab, click the “Advanced” button.

Select the “WINS” tab and uncheck the “Enable LMHOSTS Lookup” box.”



Now, check the Apache test page at http://localhost/. This time, it should work!

Leave a comment