Contents

Setup & Run XAMPP Server

Introduction

XAMPP is a free, open-source cross-platform web server solution that provides an easy way to set up a local development environment. This guide will walk you through installation and setup on:

  • Linux
  • Windows
  • macOS

Linux

Arch Linux

  • Installation

    1. Enable AUR (Arch User Repository) if not already enabled
    2. Install using an AUR helper:
      yay -S xampp
    3. Accept default options during installation

Setup and Configuration

  1. Add XAMPP to your PATH:
    echo 'export PATH="$PATH:/opt/lampp"' >> ~/.bashrc
    source ~/.bashrc
  2. Start XAMPP:
    sudo /opt/lampp/lampp start

Using XAMPP

  1. Start/Stop services:

    sudo /opt/lampp/lampp start  # Start all services
    sudo /opt/lampp/lampp stop   # Stop all services
  2. Test installation by visiting http://localhost

  3. Create PHP project:

    sudo nano /opt/lampp/htdocs/test.php

    Add:

    <?php
    echo "Hello from Arch Linux!";
    ?>
    
  4. Access phpMyAdmin at http://localhost/phpmyadmin

Ubuntu

Installation

  1. Download the latest installer(may vary time by time):

    wget https://downloadsapachefriends.global.ssl.fastly.net/xampp-files/8.2.4/xampp-linux-x64-8.2.4-0-installer.run
  2. Make executable and install:

    chmod +x xampp-linux-*-installer.run
    sudo ./xampp-linux-*-installer.run

Using XAMPP

Same as Arch Linux commands. Web root directory: /opt/lampp/htdocs

Windows

Installation

  1. Download installer from https://www.apachefriends.org
  2. Run .exe file
  3. Disable any antivirus temporarily if needed
  4. Follow installer wizard (keep default components)

Setup and Configuration

  1. Launch “XAMPP Control Panel” from Start menu
  2. Configure firewall to allow Apache/MySQL

Using XAMPP

  1. Start Apache and MySQL from Control Panel
  2. Test with http://localhost
  3. Web root directory: C:\xampp\htdocs
  4. Create database:

macOS

Installation

  1. Download .dmg from https://www.apachefriends.org
  2. Double-click image and drag XAMPP to Applications
  3. Open from Applications folder

Setup and Configuration

  1. First run:
    sudo /Applications/XAMPP/bin/start
  2. Enable automatic start:
    • Use “Manager-OSX” in Applications/XAMPP folder

Using XAMPP

  1. Start/Stop services via Manager-OSX GUI
  2. Web root directory: /Applications/XAMPP/htdocs
  3. Secure MySQL:
    sudo /Applications/XAMPP/xamppfiles/xampp security

Securing Your Installation

  1. Set MySQL root password
  2. Change phpMyAdmin authentication
  3. Use strong credentials for production-like environments

Troubleshooting

Port Conflicts

  1. Check running services:

    sudo netstat -tulpn | grep ':80'
  2. Change XAMPP ports in configuration files if needed

Permission Issues (Linux/macOS)

  1. Ensure proper ownership:
    sudo chown -R $USER /opt/lampp/htdocs

Windows Specific Issues

  1. Disable IIS/Skype if port 80 conflicts

  2. Run Control Panel as Administrator

    Now, we can successfully run XAMPP server locally…