How to install XAMPP on Windows?

XAMPP is the most popular and the most compatible package which is used to set up a runtime environment for various technologies like PHP, MySQL, PERL, etc. It is a single solution to many problems. It is widely used to create a live PHP based server within the local computer, which helps the developer to run the script without the use of the actual online server.

For MySQL also, you can choose to separately download MySQL for your system or you can choose XAMPP that comes with MySQL Server pre-packaged along with Apache( PHP Server) and other technologies. XAMPP also offers additional software tools like PHPMyAdmin for Database management, JSP Tomcat server, FileZilla FTP server, etc. All of the services in one place.

In this tutorial, we will see how you can download XAMPP for your local system and its installation process. We will also go through some of the common queries regarding the XAMPP server. We are taking Windows as an example here, all the steps are quite similar in every OS. Let’s start:

Steps to install XAMPP on Windows:

  • Go to the website, and click on the ‘XAMPP for Windows’ button to download the latest XAMPP package.
  • Open the downloaded package to start the installation process. On the welcome screen, click on the Next.
  • Now choose the required components you want to install, or leave it with the default selected items and click on Next button.
  • This step is nothing just uncheck the Learn more about bitnami option, it is just promotional stuff, now click Next button.
  • In the next step, you have to choose the directory to install the htdocs folder. By default, it will be like ‘C:\xampp’, change it if you want, or just go with the default. In this case, the ‘htdocs’ folder will be inside the ‘XAMPP’ folder.
  • If your PC asks you to allow the modules from Windows Firewall then Allow access.
  • After the installation, click on the Finish button.
  • Open the control panel if it is not automatically opened up after the installation.
  • Now, for PHP start the Apache server and for the MySQL database, start MySQL by clicking on the Start button on the control panel.
Note : If any server is not starting then it could be because the default port used by the servers is being occupied by any other application on your PC. In this case, stop the other service, usually, it is skyping, or change the ports of your server. You will find plenty of articles on the internet to solve this error.

To Check if PHP is Working: After starting the servers, to check if those are working perfectly, then go to your browser and type http://localhost or http://localhost/index.php. It will run the default index page within the ‘htdocs’ folder or it will show an error if the apache server is not working properly.

Note : Remember that each file has to be inside ‘htdocs’ folder if you want to run it on within the XAMPP server. Create separate folders for each project inside ‘htdocs’, and enter the full path of the folder to open the project.

For example, if we create a folder coderepublics inside ‘htdocs’ and it has a file named as ‘index.php’, then the root ‘URL’ of the website will be ‘http://localhost/coderepublics/’. The servers take ‘index.php’ as homepage and it is not necessary to specify this file in the URL as the servers will automatically open it if you don’t specify any filename. Other than that if you want to open a particular file then you have to include the name of that file, for example: ‘http://localhost/coderepublics/helloWorld.php’.

Advantages of XAMPP:

  • It is an open-source package and easily available for many platforms like Windows, Linux, and Mac OS.
  • It is lightweight and very easy to use.
  • It provides different server environments for different technologies in one place.
  • It provides frequent updates with each new upgrade to easily manage administrative tasks like security.

Advantages of XAMPP:

  • Apache: It is used to process the HTTP request. It helps in running of PHP applications.
  • MySQL: It enables the use of MySQL in the projects. It provides a database management system in XAMPP which runs on SQL.
  • Perl: It is one of popular high-level programming language which is used for text editing to serve the purpose of web development and network programming.

Color Picker

List of color names supported by all browser »

Character Code

List of character codes to display special character »

Language Code

List of all language supported by all browser »

Country Code

List of Country code supported by all browser »

Latest Updates

PHP Introduction

How to Run a PHP program in Xampp?

How can I create a phpinfo.php page?

How to Define a Variable in PHP

PHP Echo and Print Statements

Working with PHP Operators

Understanding the PHP Data Types

How to Write Comments in PHP

How to Define a Constant in PHP

PHP if...else...elseif Statements