Skip to main content

PHP Installation using XAMPP

 PHP is a server-side scripting language which requires a server to be executed.

We will be using installing PHP using the XAMPP stack.

XAMPP can be downloaded for all operating system. By installing XAMPP, we also install:

1. Apache (Server)

2. PHP (Server-side script)

3. MySQL (database)

Here are the steps to install:

Go to the XAMPP download page - https://www.apachefriends.org/download.html

Download and then proceed with installation. Screenshots are provided for your guidance.













Click Start button in Apache Module to start server. Click Start in MySQL Module to enable connecting to database.


You can see the ports 80,443 (80 - http and 443 - https), 3306 are allocated respectively. If these ports are not available, try making them free and use it.

Else, you have to click config button to make port changes.

How to assign different port to Apache server?

1. When you get the screen below, you try starting Apache service, you will end up with error.


2. Click config button of Apache Module


3. Choose the first file from the pop up - httpd.conf



4. You will be asked to choose from list of programs to open it. Choose a text editor. I opened this file in Notepad as below. Look for the line Listen as marked:


5. Change the port 80 to some other xxxx (Make sure xxxx is not used for any other service)
I made the change as following:


6. Once done, save and close the file. Come back to XAMPP control panel. Start Apache:


The service must have been started as above. 

How to access XAMPP dashboard?

If you have started Apache in the default port,

Go to http://localhost/ for dashboard page:




If you have a different port number from the default value 80, example port 8080 as explained above, you have to include the port number.

Go to http://localhost:8080/ for dashboard page:



XAMPP is installed in C:/xampp folder. When you develop web applications, you ought to create folder with project names inside C:/xampp/htdocs folder.

Assume you create a project named newproject as C:/xampp/htdocs/newproject

  • When you want to run the project, use http://localhost/newproject 
  • If you access via port 8080, use http://localhost:8080/newproject

Comments