hacktechmedia.com

Step-by-Step: Running WordPress Locally with XAMPP in Minutes

how to install worpresss on xampp server

Step-by-Step Tutorial: Installing WordPress on XAMPP
Prerequisites

  • XAMPP: Download and install from apachefriends.org for your OS (Windows, macOS, or Linux).
  • WordPress: Download the latest version from wordpress.org.
  • A web browser and a text editor (e.g., Notepad or VS Code).

Step 1: Install and Set Up XAMPP

  1. Download XAMPP:
    • Visit apachefriends.org and download XAMPP for your OS.
  1. Install XAMPP:
    • Run the installer, keeping the default directory (e.g., C:\xampp on Windows).
    • Ensure Apache and MySQL are selected.
  2. Start XAMPP:
    • Open the XAMPP Control Panel and click “Start” for Apache and MySQL.
  3. Test XAMPP:
    • Open a browser and go to http://localhost. You should see the XAMPP dashboard.

Step 2: Download and Prepare WordPress

  1. Download WordPress:
    • Go to wordpress.org and download the latest .zip file.
  1. Extract WordPress:
    • Unzip the downloaded file (e.g., wordpress-6.x.x.zip) to a temporary location.
  2. Move WordPress to XAMPP:
    • Navigate to C:\xampp\htdocs (or equivalent).
    • Create a folder named wordpress in htdocs.
    • Copy all files from the extracted WordPress folder to C:\xampp\htdocs\wordpress.
    • renamed the copy folder name “mywebsite”

Step 3: Create a Database for WordPress

  1. Access phpMyAdmin:
    • Go to http://localhost/phpmyadmin in your browser.
  1. Create a New Database:
    • Click the “Databases” tab in phpMyAdmin.
    • Enter mywebsite_db in the “Create database” field and click “Create.”
  1. Note the Database Details:
    • Database name: mywebsite_db.
    • Username: root (default for XAMPP).
    • Password: (leave blank, as XAMPP’s default root user has no password).

Step 4: Configure WordPress

  1. Access WordPress Setup:
    • Go to http://localhost/mywebsite in your browser.
    • Select your preferred language and click “Continue.”
  2. Enter Database Details:
    • Click “Let’s go!” on the next screen.
    • Fill in:
      • Database Name: mywebsite_db.
      • Username: root.
      • Password: Leave blank.
      • Database Host: localhost.
      • Table Prefix: wp_ (or your preference).
    • Click “Submit,” then “Run the installation.”
  3. Complete Installation:
    • Enter site details:
      • Site Title: Your website’s name.
      • Username: Admin username (e.g., admin).
      • Password: Choose a strong password.
      • Your Email: Enter a valid email.
      • Search Engine Visibility: Uncheck for local testing.
    • Click “Install WordPress.”
  4. Log In:
    • After installation, click “Log In” and use your credentials..

Step 5: Test Your WordPress Site

  1. Access the Site:
    • Visit http://localhost/wordpress to view your site’s front end.
  2. Access the Admin Dashboard:
    • Go to http://localhost/wordpress/wp-admin and log in.
    • Customize themes, plugins, or content as needed.

Troubleshooting Tips

  • Apache/MySQL Won’t Start:
    • Check for port conflicts (80 for Apache, 3306 for MySQL). Adjust ports in XAMPP if needed.
  • Database Connection Error:
    • Verify database name (mywebsite_db), username (root), and password (blank).
  • Page Not Found:
    • Ensure WordPress files are in htdocs/wordpress and Apache is running.

Optional: Configure Permalinks

  1. In the WordPress dashboard, go to Settings > Permalinks.
  2. Select “Post name” and save.
  3. If permalinks fail, enable mod_rewrite:
    • Open C:\xampp\apache\conf\httpd.conf.
    • Uncomment LoadModule rewrite_module modules/mod_rewrite.so by removing the #.
    • Restart Apache.

Summary of Key URLs

  • WordPress site: http://localhost/wordpress
  • Admin dashboard: http://localhost/wordpress/wp-admin
  • phpMyAdmin: http://localhost/phpmyadmin

Notes

  • This is for local development only. For a live site, use a web host.
  • Back up htdocs/wordpress and mywebsite_db before changes.
  • Search for “XAMPP WordPress installation” on Google or YouTube for visual guides if needed.

Subscribe to our newsletter

Get updates and learn from the best.

More to explore

The best MA & NH

Don't play hide-and-seek with people who are searching for you

Lorem ipsum dolor sit amet, consectetur adipiscing elit.