XAMPP Local Development Environment Guide

Set up a local Apache, MariaDB, and PHP environment using XAMPP on Windows, macOS, or Linux, and access your site via localhost.


XAMPP is a cross-platform local web development environment, named from X (cross-platform) + Apache + MariaDB + PHP + Perl. It is easy to install, well-documented, and commonly used by beginners and WordPress/PHP developers as a localhost solution.

What XAMPP Includes

  • Apache: HTTP server
  • MariaDB (MySQL alternative): Database
  • PHP: Server-side language
  • phpMyAdmin: Web database management tool
  • Perl (optional component)

Installation and Startup

  1. Go to Apache Friends to download the XAMPP installer for your operating system.
  2. After installation, open the XAMPP Control Panel.
  3. Click Start next to Apache and MySQL to start the services; the status bar will show running if successful.

Default Access Addresses

PurposeAddress
Control Panel / Welcome Pagehttp://localhost
Alternative Porthttp://localhost:8080
phpMyAdminhttp://localhost/phpmyadmin

Common paths for the web root directory (htdocs):

  • Windows: C:\xampp\htdocs\
  • macOS: /Applications/XAMPP/htdocs/
  • Linux: /opt/lampp/htdocs/

Place your project folder in htdocs, for example htdocs/blog/, to access it via http://localhost/blog/.

Working with WordPress

XAMPP is a common choice for locally installing WordPress:

  1. Create a new database in phpMyAdmin;
  2. Download WordPress and extract it to htdocs/wordpress;
  3. Access http://localhost/wordpress in your browser to complete the installation wizard.

Common Issues

Apache Fails to Start (Port Conflict)
Ports 80 or 443 may be in use. You can change Listen 80 to Listen 8080 in httpd.conf, then access via http://localhost:8080.

MySQL Fails to Start
Check if another MySQL instance is running; review the error messages in the XAMPP log panel.

localhost Shows XAMPP Welcome Page Instead of Your Project
Ensure your project files are in htdocs and that the URL path matches the folder name.

Summary

XAMPP is cross-platform and quick to set up, making it suitable for local PHP and CMS development. After starting Apache and MySQL, you can debug your site locally using http://localhost.

访客计数:------ Best viewed in Netscape Navigator · 800×600 © LocalHost Run