XAMPP is a local server environment that includes Apache (for running PHP), MySQL (for the database), and PHPMyAdmin (for managing databases).

Posted At: Mar 25, 2025 - 31 Views

This guide will walk you through the complete installation of WordPress on XAMPP for local development. Follow each step carefully to set up your WordPress environment on your computer.


Step 1: Download and Install XAMPP

XAMPP is a local server environment that includes Apache (for running PHP), MySQL (for the database), and PHPMyAdmin (for managing databases).

1.1 Download XAMPP

1.2 Install XAMPP

  • Run the XAMPP installer you downloaded.
  • Click Next and select the required components:
    • Apache โœ… (Required)
    • MySQL โœ… (Required)
    • PHP โœ… (Required)
    • phpMyAdmin โœ… (Required)
    • Other components are optional.
  • Choose the installation directory (default: C:\xampp\).
  • Click Next and complete the installation.

1.3 Start XAMPP Services

  • Open XAMPP Control Panel.
  • Click Start for both:
    • Apache (for PHP processing)
    • MySQL (for the database)
  • Once both services are running (marked green), XAMPP is ready.

๐Ÿ‘‰ Test if XAMPP is working by opening a browser and visiting:
๐Ÿ”— http://localhost/
If you see the XAMPP dashboard, it means XAMPP is working correctly.


Step 2: Download and Extract WordPress

Now, letโ€™s download WordPress and place it in the XAMPP directory.

2.1 Download WordPress

  • Visit the official WordPress website:
    ๐Ÿ”— https://wordpress.org/download/
  • Click Download WordPress (latest version).
  • The file will be downloaded as a ZIP file.

2.2 Extract WordPress into XAMPPโ€™s htdocs Folder

  • Go to the XAMPP installation folder:
    Windows: C:\xampp\htdocs\
    Mac: /Applications/XAMPP/htdocs/
  • Extract the WordPress ZIP file inside the htdocs folder.
  • Rename the extracted folder (e.g., mywebsite).
  • Now, your WordPress files should be located at:
    ๐Ÿ”— C:\xampp\htdocs\mywebsite\

Step 3: Create a WordPress Database

WordPress needs a MySQL database to store data like posts, users, and settings.

3.1 Open phpMyAdmin

  • In a browser, go to:
    ๐Ÿ”— http://localhost/phpmyadmin/
  • This opens phpMyAdmin, a database management tool.

3.2 Create a New Database

  • Click on the Databases tab.
  • Under Create database, enter a name (e.g., wordpress_db).
  • Choose utf8_general_ci as the collation.
  • Click Create.

๐Ÿ‘‰ The database is now ready. You donโ€™t need to create tablesโ€”WordPress will handle that during installation.


Step 4: Configure WordPress Installation

Now, letโ€™s connect WordPress to the database and complete the installation.

4.1 Open WordPress Setup in Browser

  • Open a browser and go to:
    ๐Ÿ”— http://localhost/mywebsite/
  • Select your Language and click Continue.

4.2 Enter Database Connection Details

You will be asked to enter database details:

  • Database Name: wordpress_db (the name you created in phpMyAdmin)
  • Username: root (default for XAMPP)
  • Password: (leave it blank)
  • Database Host: localhost
  • Table Prefix: wp_ (default, change if needed)

Click Submit.

If the connection is successful, click Run the Installation.


Step 5: Set Up WordPress Admin Account

5.1 Enter Website and Admin Details

  • Site Title: Your website name.
  • Username: Your WordPress admin username.
  • Password: Set a strong password.
  • Your Email: Enter your email.
  • Search Engine Visibility: Leave unchecked (only relevant for live sites).

Click Install WordPress.

5.2 Login to WordPress Dashboard

Once installed, go to:
๐Ÿ”— http://localhost/mywebsite/wp-admin/

Enter your username & password, then click Log In.

๐ŸŽ‰ Youโ€™re now inside your WordPress dashboard!


Step 6: Start Building Your WordPress Website

6.1 Choose a Theme

  • Go to Appearance > Themes.
  • Click Add New and choose a theme or upload one.

6.2 Install Plugins

  • Go to Plugins > Add New to install useful plugins like:
    • Elementor (for easy page building)
    • Yoast SEO (for SEO optimization)
    • Contact Form 7 (for forms)
    • WooCommerce (for eCommerce)

6.3 Start Creating Content

  • Go to Posts to write blog posts.
  • Go to Pages to create new website pages.

Troubleshooting Issues

1. Apache or MySQL Not Starting?

  • Error: Port 80 or 3306 is already in use?
    • Open XAMPP Control Panel > Config > Service and Port Settings.
    • Change Apache port to 8080 and MySQL port to 3307.
    • Restart XAMPP.

2. WordPress Canโ€™t Connect to Database?

  • Double-check:
    • Database Name: wordpress_db
    • Username: root
    • Password: (leave blank)
    • Database Host: localhost

3. "The Requested URL Was Not Found" Error?

  • Open XAMPP Control Panel โ†’ Apache โ†’ Click Config โ†’ Select httpd.conf.
  • Find this line:

    DocumentRoot "C:/xampp/htdocs"
    
  • Ensure the correct path to your WordPress folder is set.

Final Words ๐Ÿš€

Congratulations! Youโ€™ve successfully installed WordPress on XAMPP for local development. ๐ŸŽ‰

Now you can: โœ… Develop your website locally.
โœ… Test themes and plugins before deploying live.
โœ… Learn and experiment without breaking a real website.

Your Cart
window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-53QWJTFMC4');