BENTECH

How to Install WordPress Locally on Your PC Using XAMPP

This tutorial teaches how to set up a local WordPress development environment on a Windows PC using XAMPP. The process begins with downloading the official XAMPP package from…

Watch the video tutorial on YouTube

Overview

This tutorial teaches how to set up a local WordPress development environment on a Windows PC using XAMPP. The process begins with downloading the official XAMPP package from Apache Friends, running the installer with administrative rights, handling Windows Defender Firewall warnings, and verifying the XAMPP Control Panel. It also shows a troubleshooting fix for an INI file permission error when configuring Apache and MySQL to start automatically. The second phase covers downloading the official WordPress core files from wordpress.org (differentiating it from wordpress.com) and placing them into XAMPP's web directory, `C:\xampp\htdocs`. The video illustrates two methods for extracting the ZIP archive—either extracting directly into a custom site folder or extracting locally and renaming the folder—explaining that `htdocs` acts as the root hosting environment for local sites. The final phase details launching Apache and MySQL services, opening `localhost/dashboard`, and utilizing phpMyAdmin to create a dedicated database and inspect root database privileges. The tutorial finishes by running the browser-based WordPress setup wizard at `localhost/<folder_name>`, configuring the database credentials, completing the site installation with custom administrative credentials, and accessing the WordPress admin dashboard.

Downloading and Installing XAMPP

00:00

To build and test WordPress websites offline, you need a local web server stack containing Apache, MySQL/MariaDB, and PHP. Visit the official Apache Friends website at apachefriends.org to obtain the legitimate installer. Choose the current Windows build or select specific PHP releases if required. Once downloaded, launch the installer as an administrator. If Windows User Account Control displays a prompt or a warning appears regarding missing write permissions in Program Files, click OK to proceed. Accept the default software component selections and install to the root path `C:\xampp`. Complete the wizard and allow Apache through the Windows Defender Firewall when prompted.

  • Download XAMPP strictly from apachefriends.org to avoid third-party bloatware.
  • Run the installer with administrator privileges to allow directory creation and service registration.
  • Default installation path is `C:\xampp`.
  • Grant network permissions when Windows Defender Firewall prompts appear for Apache.

Configuring the XAMPP Control Panel and Resolving INI Errors

03:12

Locate and launch `xampp-control.exe` from `C:\xampp` or your Windows Start menu. In the control panel, start both Apache and MySQL. To avoid manually starting these services every session, open 'Config' in the top right and check the autostart boxes for Apache and MySQL. If clicking 'Save' throws an error stating `Cannot create file C:\xampp\xampp-control.ini: Access is denied`, close the control panel, navigate to `C:\xampp`, delete the existing `xampp-control.ini` file, relaunch XAMPP as administrator, select your language, and re-apply the autostart configuration.

  • Both Apache (web server) and MySQL (database server) must be running to host WordPress.
  • Autostart options save time by initiating services upon opening XAMPP.
  • Delete `xampp-control.ini` in `C:\xampp` if access-denied errors block configuration saves.
del C:\xampp\xampp-control.ini

Downloading and Extracting WordPress Core Files into htdocs

03:45

Download the official self-hosted core files from wordpress.org (not wordpress.com) by clicking 'Get WordPress'. The download arrives as a ZIP archive (version 6.0.3 in the video). In XAMPP, web-accessible files must reside inside `C:\xampp\htdocs`. You can extract the ZIP directly into a subfolder named after your project inside `htdocs`, or extract the archive locally, move the uncompressed `wordpress` folder into `htdocs`, and rename it to your desired site name (e.g., `bentech`).

  • Use wordpress.org for the free, self-hosted WordPress software package.
  • `C:\xampp\htdocs` is the web root directory where every local website directory must reside.
  • The folder name inside `htdocs` directly dictates the local URL path (e.g., `localhost/bentech`).

Database Setup via phpMyAdmin and WordPress Web Installation

08:54

Verify that XAMPP is working by navigating to `http://localhost` in your browser. From the dashboard, click 'phpMyAdmin' (or navigate to `http://localhost/phpmyadmin`). Go to the 'Databases' tab, enter a new database name matching your project (such as `bentech`), and click 'Create'. Verify under 'Privileges' that the `root` user on `localhost` has full permissions and no password set by default. Next, open a new tab and browse to `http://localhost/bentech`. Choose your language and click 'Let's go'. Enter your database credentials: Database Name (`bentech`), Username (`root`), Password (leave completely empty/blank), Database Host (`localhost`), and Table Prefix (`wp_`). Click 'Submit' and then 'Run the installation'. Supply your Site Title, Admin Username, Password, and Email Address, then finalize the installation and log in to the newly created WordPress dashboard.

  • Create the MySQL database in phpMyAdmin prior to running the WordPress 5-minute install script.
  • Default local XAMPP MySQL credentials are user `root` with no password.
  • Leave the password field blank in the WordPress setup screen; do not enter placeholder text.
  • Access the site dashboard after installation via `http://localhost/<folder_name>/wp-admin`.