Close Menu
LEARN NEW THINGSLEARN NEW THINGS
    Instagram Facebook YouTube Telegram
    LEARN NEW THINGSLEARN NEW THINGS
    • Home
    • HTML & CSS
    • JavaScript
    • PHP
    • Blog
    • Contact
    LEARN NEW THINGSLEARN NEW THINGS
    Home » Installing XAMPP to Run PHP Locally – Complete Beginner’s Guide
    PHP

    Installing XAMPP to Run PHP Locally – Complete Beginner’s Guide

    RukeshBy RukeshJune 9, 2025No Comments3 Mins Read
    Share WhatsApp Facebook LinkedIn Email Telegram
    Follow Us
    Instagram YouTube

    Introduction

    If you’re learning PHP or developing web applications, you’ll need a local server to test your code. That’s where XAMPP comes in. XAMPP is a free and open-source software package that includes Apache (server), MySQL (database), PHP, and Perl, making it perfect for running PHP locally. In this guide, we’ll walk you through the steps to install XAMPP and run your first PHP script.

    What is XAMPP?

    XAMPP stands for:

    • X – Cross-platform
    • A – Apache
    • M – MySQL
    • P – PHP
    • P – Perl

    It provides a local server environment so you can run PHP code on your own machine without needing to host your project online.

    Step 1: Download XAMPP

    1. Visit the official website: https://www.apachefriends.org
    2. Choose the version for your OS (Windows, Linux, Mac).
    3. Download the installer.

    💡 Tip: Always download the latest stable version that supports your PHP version.

    Step 2: Install XAMPP

    1. Run the downloaded installer.
    2. Allow permission if prompted by your system.
    3. Select components (Apache, MySQL, PHP are must-haves).
    4. Choose the install location (default: C:\xampp).
    5. Click Next and install.

    Step 3: Start the XAMPP Control Panel

    1. After installation, launch the XAMPP Control Panel.
    2. Start Apache and MySQL modules.
    3. If everything runs without error, you’re good to go!

    🟢 Apache – Handles your PHP files
    🟢 MySQL – Manages your database

    Step 4: Test Localhost in Browser

    1. Open your browser.
    2. Type http://localhost in the address bar.
    3. You should see the XAMPP welcome page.

    🎉 Congratulations! XAMPP is now working on your computer.

    Step 5: Create Your First PHP File

    1. Go to the htdocs folder inside XAMPP directory (C:\xampp\htdocs).
    2. Create a folder named testsite.
    3. Inside that, create a file named index.php.
    4. Add this code:
    <?php
    echo "Hello, PHP World!";
    ?>
    

    Step 6: Run Your PHP File

    1. In your browser, go to:
      http://localhost/testsite/index.php
    2. You should see:
      Hello, PHP World!

    Now your local PHP environment is ready!

    Common Issues & Solutions

    Port 80 in use?

    • Change Apache port from 80 to 8080 in config settings.
    • Then visit http://localhost:8080.

    MySQL not starting?

    • Ensure no other MySQL service is running.
    • Use Task Manager to close conflicting services.

    Why Use XAMPP for PHP Development?

    ✅ Easy to set up
    ✅ Works on all OS
    ✅ Includes all necessary tools (Apache, PHP, MySQL)
    ✅ Great for learning and testing projects locally

    Conclusion

    Installing XAMPP is the first step toward learning PHP and web development. With XAMPP, you can build dynamic websites and test them locally before publishing them online. Whether you’re a beginner or an advanced coder, XAMPP is a must-have in your dev toolkit.

    Post Views: 4
    Apache and MySQL Beginner Web Dev Install XAMPP Learn PHP Local Server Setup Localhost PHP Run PHP Locally web development XAMPP
    Follow on Facebook Follow on Instagram Follow on YouTube Follow on LinkedIn Follow on WhatsApp
    Share. Facebook LinkedIn Telegram WhatsApp Copy Link
    Rukesh
    • Website

    Related Posts

    Introduction to PHP – What is PHP?

    June 9, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Most Viewed
    HTML & CSS

    Top 10 HTML Tags You Must Know as a Beginner

    By RukeshJune 9, 20250

    If you’re just starting your web development journey, HTML is the first language you need…

    HTML & CSS

    What is HTML? Beginner-Friendly Guide for 2025

    By RukeshJune 9, 20250

    What is HTML? (Beginner-Friendly Explanation) HTML stands for HyperText Markup Language.It is the foundation of…

    HTML & CSS

    Create a Stunning 3D Image Slider with HTML, CSS

    By RukeshMay 29, 20250

    Introduction Looking to add a visually impressive, 3D-style image slider to your website? You’re in…

    HTML & CSS

    Create Beautiful Hover Social Media Icons Using HTML & CSS

    By RukeshMay 29, 20250

    Introduction Are you looking to add stylish social media icons to your website? In this…

    Top Reviews
    Advertisement
    Demo
    LEARN NEW THINGS
    Instagram Facebook Telegram YouTube
    • Home
    • HTML & CSS
    • JavaScript
    • Blog
    • PHP
    • Get In Touch
    Visit counter For Websites
    © 2025 Learn New Things. Designed by Learnnewthings_25.

    Type above and press Enter to search. Press Esc to cancel.