How to Install XAMPP and WordPress Locally on PC/Windows

wordpress

What is XAMPP?

XAMPP stands for Cross-Platform, Apache, MySQL, PHP, and Perl. It’s a simple and lightweight solution that allows you to create a local web server for testing purposes. XAMPP is widely used by developers to run websites locally before making them live.

What is WordPress?

WordPress is an online, open-source website creation tool written in PHP. In simpler terms, it’s probably the easiest and most powerful blogging and website content management system (CMS) in existence today. Whether you’re creating a blog, portfolio, or business website, WordPress makes it easy to manage content.


Step-by-Step Guide to Install XAMPP and WordPress Locally

Step 1: Download and Install XAMPP

  1. Visit the official website: https://www.apachefriends.org/index.html.
  2. Click on “Download” to get the latest version of XAMPP for Windows.
  3. Run the downloaded installer and follow the installation steps.
  4. After installation, launch the XAMPP Control Panel.
  5. Click “Start” next to Apache and MySQL to start the server and database.

Step 2: Download and Prepare WordPress

  1. Go to the official WordPress website: https://wordpress.org/download.
  2. Download the latest version of WordPress.
  3. Extract the downloaded ZIP file.
  4. Move the extracted WordPress folder to the htdocs directory inside your XAMPP installation folder.
    • The path should look like this: C:\xampp\htdocs\wordpress (you can rename the folder to your desired site name).

Step 3: Configure the WordPress Database

  1. Open your browser and go to http://localhost/phpmyadmin.
  2. Click on “New” to create a new database.
  3. Enter a name for your database (e.g., wordpress_db) and click “Create”.
  4. Copy the database name for later use.

Step 4: Configure WordPress Settings

  1. Go to the WordPress folder you just moved to htdocs and find the file named wp-config-sample.php.
  2. Rename it to wp-config.php.
  3. Open wp-config.php in a text editor (e.g., Notepad++ or VS Code).
  4. Locate the following lines and update them: phpCopydefine('DB_NAME', 'wordpress_db'); // Replace with your database name define('DB_USER', 'root'); // Default username for XAMPP define('DB_PASSWORD', ''); // Leave empty as XAMPP's root has no password
  5. Save the changes and close the file.

Step 5: Run the WordPress Installation

  1. Open your browser and go to http://localhost/wordpress (replace “wordpress” with your folder name if you renamed it).
  2. Choose your preferred language and click “Continue”.
  3. Fill in the required information:
    • Site Title
    • Username
    • Password
    • Your Email
  4. Click “Install WordPress”.

Step 6: Finalize the Setup

  • After installation, you’ll see a success message.
  • Click “Log In” to access your new WordPress site.
  • Enter the username and password you just created.

🎉 Congratulations! Your WordPress site is now live locally on your PC.


Troubleshooting Tips:

  • If you can’t access localhost, make sure Apache and MySQL are running in the XAMPP Control Panel.
  • If MySQL fails to start, check if another service (like Skype) is using port 3306.
  • Clear your browser cache if you encounter loading issues.