How To Change XAMPP Apache Server Port

What is XAMPP?

XAMPP is the most popular PHP development environment. It’s a completely free, easy-to-install Apache distribution containing MariaDB, PHP, and Perl. The XAMPP open source package has been set up to be incredibly easy to install and use. Just download and start the installer. It’s that easy.

I faced an issue while running it after installation. It shows –

That means that in my machine VMware is installed and it uses port 443. By default Xamp server also need to use the same port.

Solution

We will reconfigure Apache and the Control Panel to listen on a different port. In this tutorial, we will learn step-by-step to change the XAMPP server port and fix the Apache port error.

Step 1:

  • Open XAMPP Control Panel.
  • Click the Config button of Apache Module.
  • Click Apache (httpd.conf)
  • or directly we can open this location to get ‘httpd.conf‘ file >> C:\xampp\apache\conf

Now find the following lines and replace them with the changes:

  • Find ‘Listen 80‘ & replace it with ‘Listen 8081‘ (or any free port)
  • Find ‘ServerName localhost:80‘ & replace it with ‘ServerName localhost:8081

  • Again click the Config button of Apache Module
  • Now click Apache (httpd-ssl.conf)
  • or directly we can open this location to get ‘httpd-ssl.conf‘ >> C:\xampp\apache\conf

Now look for the following lines and replace them with the changes:

  • Find ‘Listen 443‘ & replace it with Listen 4433
  • Find <VirtualHost _default_:443> & replace it with <VirtualHost _default_:4433>

Step 2:

  • Now click the Config button of the Main Control Panel

  • Click Service and Port Settings
  • On Main Port, type 8081
  • On SSL Port, type 4433

  • Now Start the Apache Module

  • Since you have changed the port no, so now you will run localhost like this http://localhost:8081/
  • To access your project, type the folder name like this http://localhost:8081/MyProjects/Test/

Facebook Comments Box
Please like or share this post if you found it helpful, thank you.
Share on Facebook
Facebook
0Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin
Email this to someone
email
Print this page
Print

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *