
PHP Installation in Local Server Using XAMPP (With Video)
You can start learning the basics of programming in PHP with the help of any of the online PHP compilers freely available on the Internet. This will help you get acquainted with the features of PHP without installing it on your computer. Later on, you can install a full-fledged PHP environment on your local machine.
Software Components of XAMPP
XAMPP is a free and open-source cross-platform web server solution stack package developed by Apache Friends. It includes key components required to run PHP-based web applications locally.
-
Apache – Acts as the main web server that processes HTTP requests. It's the default server bundled in XAMPP and is widely used globally.
-
MySQL – Serves as the database management system in XAMPP. It's open-source, fast, and reliable for managing structured data.
-
PHP – A powerful server-side scripting language used for developing dynamic websites and applications. It works seamlessly with MySQL and is embedded into HTML.
-
Perl – A high-level programming language focused on text processing and is often used in web development and system administration.
Steps to Install XAMPP on Windows
-
Download XAMPP
Visit the official Apache Friends website and download the installer for XAMPP (recommended: version 7.4). -
Run the Installer
Open the downloaded file and proceed with the installation. You can leave the default components selected (MySQL, PHP, phpMyAdmin) and click Next. -
Bitnami Option
Uncheck the option “Learn more about Bitnami for XAMPP” and proceed by clicking Next. -
Choose Installation Folder
Set the root installation path (e.g.,C:\xampp
). This will be the base directory that includes thehtdocs
folder where your projects will reside. -
Firewall Access
Allow XAMPP to pass through Windows Firewall when prompted. -
Finish Setup
After the installation, click Finish to complete the setup and launch the XAMPP Control Panel. -
Start Apache & MySQL
In the control panel, click Start beside Apache and MySQL to start the local server.Note: If Apache doesn’t start, another service might be using port 80. You may need to stop that service or change the Apache port in the config.
Testing Your Local Server
-
Visit Localhost
Open your browser and type:
http://localhost
If XAMPP is installed correctly, the XAMPP welcome page will be displayed. -
Create a PHP File
Go to the folderC:\xampp\htdocs
, and create a new file calledtest.php
. Paste the following code: -
Run the PHP Script
Open your browser and go to:
http://localhost/test.php
If you see the PHP information page, then PHP is working correctly in your local server.
Project Folder Structure
To organize your projects:
-
Inside the
htdocs
folder, create a sub-folder (e.g.,learning
) -
Create a file like
helloWorld.php
inside that folder -
Access it via
http://localhost/learning/helloWorld.php
Web servers usually look for an
index.php
orindex.html
file as the default landing page.
Watch the Video Tutorial
For a complete walkthrough of installing XAMPP 7.4, configuring Sublime Text, and verifying PHP using phpinfo(), check out the video tutorial:
Configuration Tips
-
All configuration files are located inside:
C:\xampp\apache
,C:\xampp\mysql
, andC:\xampp\php
-
Restart Apache or MySQL after making changes to config files.
Leave a Comment