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 thehtdocsfolder 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
htdocsfolder, create a sub-folder (e.g.,learning) -
Create a file like
helloWorld.phpinside that folder -
Access it via
http://localhost/learning/helloWorld.php
Web servers usually look for an
index.phporindex.htmlfile 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.
11 Comment(s)
I will immediately seize your rss feed as I can’t in finding your e-mail subscription link or e-newsletter service. Do you’ve any? Kindly let me realize so that I could subscribe. Thanks.
Real instructive and great structure of content material, now that's user genial (:.
I’ll right away grasp your rss feed as I can not in finding your email subscription hyperlink or e-newsletter service. Do you’ve any? Kindly let me realize so that I could subscribe. Thanks.
I’ll right away grasp your rss feed as I can not in finding your email subscription hyperlink or e-newsletter service. Do you’ve any? Kindly let me realize so that I could subscribe. Thanks.
Hi, I do believe this is a great blog. I stumbledupon it ;) I will return yet again since I saved as a favorite it. Money and freedom is the best way to change, may you be rich and continue to help others.
You've made some really good points there. I looked on the web for more info about the issue and found most individuals will go along with your views on this site.
Wow, this paragraph is pleasant, my sister is analyzing such things, thus I am going to convey her.
Everyone loves what you guys are usually up too. This type of clever work and exposure! Keep up the great works guys I've included you guys to my blogroll.
These are in fact fantastic ideas in regarding blogging. You have touched some good points here. Any way keep up wrinting.
I every time spent my half an hour to read this webpage’s posts daily along with a mug of coffee.
You have made some good points there. I looked on the web for more information about the issue and found most individuals will go along with your views on this site.
Leave a Comment