Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversThanksgiving DealsAmazon USThanksgiving week: Black Friday picks start earlyAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
FREEDOM251

Freedom251 › Blog

Set Up XAMPP and a Local WordPress Site on Windows with PowerShell

By Freedom251 Team · · 11 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

XAMPP on Windows gives you a local Apache web server, a MariaDB database server, PHP, and the tools WordPress needs. This guide takes you from downloading XAMPP through starting Apache and the database, creating a WordPress database, placing the files under htdocs, and completing the browser installer. Here, “deploy” means creating a private development site on your own Windows computer—not publishing a production website. Apache Friends explicitly says, “XAMPP is not meant for production use but only for development environments.”

The safest workflow is to install or extract XAMPP, verify its bundled PHP and database versions against WordPress’s current requirements, start services from the Control Panel, and use PowerShell for repeatable file and diagnostic tasks. Registering Apache or the database as Windows services is optional and requires Administrator privileges.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What this XAMPP and WordPress setup creates

Your finished environment will look like this:

  • Apache: serves web pages from XAMPP’s htdocs directory.
  • PHP: runs WordPress’s server-side code.
  • MariaDB (often labeled “MySQL” in older instructions): stores posts, settings, users, and plugin data.
  • WordPress: lives in a folder such as C:xampphtdocsmy-site and opens at a local URL such as http://localhost/my-site/.

XAMPP’s Windows FAQ explains that current XAMPP packages use MariaDB instead of MySQL in releases covered by its documentation, while the commands and tools remain the same. WordPress currently recommends PHP 8.3 or newer and either MariaDB 10.11 or newer or MySQL 8.0 or newer, plus HTTPS support. Check the versions bundled in the XAMPP package you download; do not infer compatibility merely from the word “MySQL.”

Use the Apache Friends Windows FAQ for XAMPP-specific behavior and the WordPress requirements page for the current baseline.

Popular on Amazon
Sale
CloudValley Adjustable Laptop Stand, Magnetic Phone Holder, Black | Aluminum Slim Monitor Side Mount Clip for iPhone MagSafe & All Phones, Portable Foldable Computer Expansion Bracket
  • Aluminum Slim Computer Side Mount Clip: Compatible with all phones, featuring a portable foldable expansion bracket in sleek black finish
  • Upgraded Magnetic Mount Technology: Designed for laptop, desktop monitor, MacBook, iPad and Tesla car screen with stable adsorption, adjustable angle, and dual-screen interaction support for improved office efficiency
  • High-End Metal Craftsmanship: Selected high-hardness aluminum alloy with CNC precision machining, matte plating process, delicate texture that is wear-resistant and anti-scratch
  • Strong Magnetic Attachment: Features upgraded high strength magnet with 200% increased magnetic force for firm phone attachment, innovative ring-shaped heat dissipation design prevents overheating and ensures no signal interference
  • Wide Range of Compatibility: Works with iPhone 18/17/16/15/14/13/12 series including Pro Max/Mini versions, includes 2 metal rings for non-magnetic phones or cases for full device compatibility

What should I download: the installer, ZIP, or 7zip archive?

Apache Friends lists three Windows distribution formats. The installer is the easiest choice for most first-time setups. ZIP and 7zip archives are useful when you want to extract XAMPP manually, but archive extraction can require an additional setup step depending on where you place the files.

Option Best fit Important detail
Installer Most users Guided installation with fewer manual steps
ZIP Portable or manually managed folders After extraction, the package may require setup_xampp.bat, depending on the destination
7zip Users who already manage 7z archives Follow the same package-specific setup guidance as the archive distribution
  1. Download XAMPP from the official Apache Friends site.
  2. Before installing, check the package’s listed PHP and MariaDB/MySQL versions. Compare them with WordPress’s current requirements rather than relying on an old XAMPP version listing.
  3. Choose a short, uncomplicated installation path. C:xampp is common, but your path can differ; every command and URL in this guide must match the path you actually use.

If you use an archive, extract it to the intended location and run the package’s setup_xampp.bat when the FAQ’s destination-dependent guidance says it is needed. Do not assume that copying an already configured XAMPP folder to a new path is sufficient.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I install XAMPP on Windows?

  1. Run the downloaded installer, or extract the ZIP/7zip package.
  2. Select the components you need. Apache, PHP, and the database server are required for this WordPress workflow; optional tools can be left out if you do not need them.
  3. Record the installation directory. In the examples below it is C:xampp.
  4. Finish the installation and open the XAMPP Control Panel. If Windows displays a permission prompt, approve it only if you downloaded the package from the official source and are installing it intentionally.

Do not place the web project in an arbitrary folder and expect Apache to serve it automatically. XAMPP’s default web-content directory is htdocs, so a site named my-site belongs at C:xampphtdocsmy-site when the default path is used.

How can I use PowerShell without pretending the whole setup is automated?

The official sources document XAMPP’s Control Panel and batch files, but they do not provide a current, package-specific end-to-end PowerShell automation script. The following commands are therefore small, illustrative helpers for checking paths, opening programs, and managing WordPress files. Run them individually, adjust the path, and validate behavior against your Windows version, PowerShell version, XAMPP package, and permissions.

# Set this to your actual XAMPP directory
$xampp = 'C:xampp'

# Confirm that the Control Panel exists
Test-Path "$xamppxampp-control.exe"

# Open the Control Panel
Start-Process "$xamppxampp-control.exe"

# Inspect the default web root
Get-ChildItem "$xampphtdocs"

# Create a folder for the local site
New-Item -ItemType Directory -Path "$xampphtdocsmy-site" -Force

# Open the local server in your default browser
Start-Process 'http://localhost/'

These commands do not start Apache or MariaDB reliably across every XAMPP release. Start and stop those components in the Control Panel unless you have verified the relevant service or executable for your exact package.

How do I start and stop Apache and the database?

Open the XAMPP Control Panel, then use the Start button beside Apache and the database module. When a module is running, the panel shows its active state and exposes controls for stopping it. Stop both modules from the panel when you finish a development session unless you intentionally registered them as Windows services.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Also popular on Amazon
Sale
AboveTEK Portable Laptop Lap Desk w/Retractable Left/Right Mouse Pad Tray, Non-Slip Heat Shield Tablet Notebook Computer Stand Table w/Sturdy Stable Work Surface for Bed Sofa Couch or Travel
  • Anti-Slip Surface - Transform your laptop into a mobile workstation with the AboveTEK portable laptop lap desk. The anti-slip surface provides a strong grip for laptops up to 15.6 inches(Diagonal), while the double rubber strip on the bottom ensures a stable display or typing experience on your lap, couch, or bed.
  • Retractable Mouse Pad - Retractable laptop mouse pad extends on both directions for the left/right handed with elevation along the edges for stopping mouse from falling off. The size of laptop tray is 14" X 9.7" and the size of mouse pad is 7.4" X 6.1".
  • Effective Heat Shield - The effective heat shield made of sturdy and thick material protects your laptop from overheating. Prioritizes your comfort and safety, an ideal lap pad or board for working anywhere.
  • EASY to Carry and Store - With an ergonomic and simplistic design, the lap desk is portable to store in a backpack. Only 15" in size, 2.2 lb of weight and with slim 0.6 inch thickness, it is ready to be easily carried around.
  • Widely Applicable - The smooth platform accommodates laptops and tablets up to 15.6 inches(Diagonal), making it a versatile accessory and one of the best gifts for mom, dad, students and professionals. Perfect for use as a laptop bed tray or tablet holder anywhere at home, library, or park.
  1. Launch xampp-control.exe.
  2. Click Start for Apache.
  3. Click Start for MySQL or the database entry shown by your XAMPP release. The underlying server may be MariaDB.
  4. Open http://localhost/ or http://127.0.0.1/.
  5. When finished, click Stop for each running module.

XAMPP’s FAQ identifies HTTP port 80, HTTPS port 443, and database port 3306 as the usual ports. A green-looking control-panel state is not a substitute for checking the browser URL and the actual page response.

Should I register Apache or MariaDB as Windows services?

No. Service registration is optional. Starting modules on demand from the Control Panel is simpler for a personal development computer; services start with Windows and can be convenient when you need the local stack continuously.

Apache Friends documents apache_installservice.bat and mysql_installservice.bat. Installing or removing a service requires an elevated Control Panel or script, so run the Control Panel or the batch file with Administrator privileges. An illustrative PowerShell launch is:

$xampp = 'C:xampp'
Start-Process "$xamppapache_installservice.bat" -Verb RunAs -Wait
Start-Process "$xamppmysql_installservice.bat" -Verb RunAs -Wait

Use those commands only after confirming that the files exist in your package and that you actually want services. If a service was created, manage it through Windows service tools or the XAMPP Control Panel, and remove it before deleting or moving the XAMPP directory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I check ports before troubleshooting Apache?

If Apache will not start, first look for another process already listening on port 80 or 443. IIS is a documented Windows example of a possible port-80 conflict. PowerShell can help identify listeners, but the output needs interpretation:

Get-NetTCPConnection -LocalPort 80,443,3306 -State Listen -ErrorAction SilentlyContinue |
  Select-Object LocalAddress,LocalPort,OwningProcess

# Replace 1234 with a process ID from the previous command
Get-Process -Id 1234

Stop or reconfigure the conflicting application only if you understand its role. Changing Apache’s ports is possible, but then your local URL must include the new port, such as http://localhost:8080/, and WordPress’s site URLs may need corresponding updates.

Also popular on Amazon
Sale
LAPGEAR Home Office Lap Desk – Pink, Fits 15.6” Laptops | Built-In Mouse Pad & Phone Slot, Integrated Device Ledge, Dual-Bolster Microbead Cushion, Carry Handle
  • Spacious Design: Measuring 21.1" wide and 12" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
  • Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy laptop support with the integrated device ledge.
  • Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
  • Durable Surface: Work with confidence on our lap desk's solid surface, featuring a blush pink color, ensuring optimal air circulation to prevent your laptop from overheating.
  • On-the-Go Convenience: With an integrated handle and lightweight design (2.14 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.

How do I download and place WordPress under htdocs?

Download the current WordPress package from WordPress.org, extract it, and place the resulting WordPress directory beneath XAMPP’s web root. A subdirectory keeps the project organized and lets you run several local sites.

  1. Download the WordPress ZIP package.
  2. Extract it to a temporary folder.
  3. Move the extracted wordpress directory to your web root.
  4. Rename it to a project-specific folder, for example my-site.

For a default installation, the target is C:xampphtdocsmy-site. The equivalent illustrative PowerShell file operations are:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
$xampp = 'C:xampp'
$zip = "$env:USERPROFILEDownloadswordpress.zip"
$temp = "$env:TEMPwordpress-extracted"

Remove-Item $temp -Recurse -Force -ErrorAction SilentlyContinue
Expand-Archive -Path $zip -DestinationPath $temp
New-Item -ItemType Directory -Path "$xampphtdocs" -Force
Move-Item "$tempwordpress" "$xampphtdocsmy-site"

Confirm that wp-admin, wp-content, and wp-includes are directly inside my-site, not one level deeper in my-sitewordpress. If the nesting is wrong, the browser will not reach the expected installer path.

How do I create the WordPress database and user?

WordPress needs a database, a database user, and the credentials that connect them. Use the database administration tool bundled or linked by your XAMPP installation, commonly exposed from the local XAMPP dashboard, and create a dedicated database and user for this site instead of reusing credentials from another project.

  1. With Apache and the database server running, open the XAMPP dashboard’s database administration link.
  2. Create a database with a simple name such as my_site.
  3. Create a dedicated database user with a strong local password.
  4. Grant that user privileges on the new database.
  5. Record the database name, username, password, and host. For a same-computer setup, the host is normally localhost; confirm the value expected by your package and installer.

Do not publish a tutorial that assumes a blank database password is safe. Even on a local machine, a dedicated credential makes it easier to isolate projects and migrate them later.

How do I finish WordPress installation in the browser?

Open the project URL after Apache and the database are running: http://localhost/my-site/. WordPress’s documented installation flow lets the browser create or complete wp-config.php from the database details.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Also popular on Amazon
Sale
MNN 15.6" 1080P Portable Monitor IPS USB-C HDMI Gaming Screen for Laptop | 15.6" FHD IPS HDR, USB-C one-cable, PC/Mac/Phone/Switch, Smart Case,Laptop , low blue, work&game
  • Full HD Portable Monitor - MNN 15.6inch portable laptop monitor with 1920*1080 resolution, advanced IPS glossy screen support 178° full viewing angle, it renders accurate and bright color, draws you into the video or game with lifelike colors and amazing detail.It can effectively reduce blue light radiation damage, no flickering, eye-care, and make it easier to watch for a long time.A second monitor for working from home.
  • Double Type-C Port -For Plug & Play, the MNN monitor provides 2 Full Feature Type-C ports. Only One USB Type-C Cable is required to connect to the power supply & display signal transmission. NOTE: Your device should support thunderbolt 3.0 or USB 3.1 Type C DP ALT-MODE.which supports multiple connect ways to your laptops, PC, Phones, Macbooks, PS5/PS4, Xbox, and Switch.
  • Lightweight Ultra Slim for Travel - As a portable external monitor,MNN portable laptop monitor easily accommodate to every suitcase and backpack and stress-free when you are holding it for a long time. They are truly portable computer monitors for travelers, students, gamers,engineers, and everyone.
  • Give consideration to work and games - through multiple display modes [Copy Mode/Extended Mode/Second Screen Mode/Portrait Mode], we can bring you a clear second screen in the meeting, and expand the screen anytime and anywhere to improve work efficiency and improve the quality of life. Adjusting to HDR mode can upgrade the image to a new level, providing you with brighter highlights,deeper and more realistic colors, more realistic images, and amazing viewing/gaming experience.
  • Powerful Smart Cover - MNN portable external monitor can work in both landscape and portrait mode, can be used as a gaming monitor, screen extender for laptop or phone. Comes with a scratch-proof smart cover made of durable PU leather exterior, doubles as a stand, provides comprehensive protection for this portable computer monitor.
  1. Choose the installation language.
  2. Enter the database name, database username, database password, and database host.
  3. Leave the table prefix at its default for a single installation, or use a distinct prefix when multiple installations intentionally share one database.
  4. Submit the form. If WordPress can write the configuration file, it creates wp-config.php; otherwise, follow the page’s instructions to create the file manually.
  5. Provide a site title, administrator username, administrator password, and administrator email address.
  6. Complete installation and sign in at http://localhost/my-site/wp-admin/.

WordPress’s official installation guide describes the package, database, configuration, file placement, and browser steps. Keep the administrator password in a password manager even though the site is local.

How do I verify that the local site works?

  1. Visit http://localhost/ or http://127.0.0.1/ and confirm that the XAMPP local page responds.
  2. Visit http://localhost/my-site/ and confirm that the WordPress front page loads.
  3. Open /wp-admin/, sign in, and create a harmless draft post.
  4. Save a setting, reload the page, and verify that it persists. This checks both PHP execution and database writes.
  5. From PowerShell, you can check the HTTP response headers without modifying the site:
Invoke-WebRequest 'http://localhost/my-site/' -UseBasicParsing |
  Select-Object StatusCode,StatusDescription

A successful response confirms that Apache returned a page; it does not prove that every plugin, rewrite rule, or mail function is configured.

What should I do if Apache will not start?

Most Apache startup failures involve a port conflict, a permission issue, or an invalid configuration. Work through these branches rather than assuming one cause.

  • Port 80 or 443 is occupied: use Get-NetTCPConnection to identify the owning process. IIS is one documented possibility. Stop the conflicting service only when appropriate, or change Apache’s configured port and use the new URL.
  • The Control Panel cannot change files: close it, reopen it with Administrator privileges, and confirm that security software is not blocking the installation directory.
  • Apache starts and immediately stops: open the Control Panel’s logs and read the first error, especially the port and configuration lines. Do not delete configuration files at random.
  • Localhost resolves unexpectedly: try 127.0.0.1 and verify that the browser is using the same port Apache is listening on.

What should I do if the database will not start or WordPress cannot connect?

  • Database module stops immediately: check whether another database server is already using port 3306. Identify the owning process before changing anything.
  • “Error establishing a database connection” in WordPress: recheck the database name, username, password, and host character for character. A running database service does not guarantee that the supplied account has privileges on the selected database.
  • MariaDB/MySQL terminology is confusing: use the database client and administration tools included with your XAMPP package. Apache Friends says the commands and tools are the same even though XAMPP has shipped MariaDB in place of MySQL for the releases covered by its FAQ.
  • Version mismatch: compare the actual bundled PHP and database versions with WordPress’s current requirements. A package that predates those recommendations may need a newer XAMPP release or a different development stack.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How do I fix a “file not found” or blank WordPress page?

Confirm the directory and URL first. If the files are in C:xampphtdocsmy-site, the URL should include /my-site/. Ensure the WordPress core directories are not nested one level too deep, and check Apache’s error log before changing PHP settings.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If the browser installer completed but the site URL points to the wrong folder or port, correct the local URL through WordPress’s settings or database tools carefully. Back up the database and files before editing URL values directly.

Can I use this XAMPP site as a public production website?

No. XAMPP’s own documentation limits it to development environments. A local installation is appropriate for theme and plugin work, content experiments, and learning; it is not a hardened public server configuration.

Also popular on Amazon
Sale
AIKOKOK Wireless Bluetooth Mouse, Rechargeable Dual Mode Mouse, Black | BT 5.2 & 2.4G USB Receiver, 3 Adjustable DPI,LED Lights,Slim,Silent,Portable Computer Mouse for Laptop,PC,MacBook,iPad,Tablet
  • 【Rechargeable Optical Mouse/Energy Saving】:Computer Mouse Built-in Durable Rechargeable Battery,High Cycle Life,No Need Change Battery;Laptop Mouse Wireless Can Be Easily Charged Using the Included USB Cable,Just 2 Hours Charging,Mouse Wireless Can Use Than 5 Days of Working Time and 30 Days of Standby Time,Standby Time is Very Long;Tablet Mouse Will Fall Asleep After 5 Minutes No-Operation to Save Power and Provides Long Term Usage;You Can Wake ipad Mouse Up By Clicking any Button
  • 【LED Colorful Breathing Light】:This Wireless Mice With 7 Different Colorful LED Breathing Lights,7 Different Color Changes Randomly While in Use,Offering Soothing Lighting;Creating Cool and Fancy Atmosphere for Office and Gaming,LED Mouse Can Give You More Fun During
  • 【Wireless Bluetooth Mouse Dual Mode】:Mouses(BT5.2/3.0 and 2.4 G)Dual Mode Realize the Free Switching of One Wireless Bluetooth Mice Between Two Devices;Bluetooth Mouse Mode Can Connect One Device Through BT5.2/3.0 and Wireless Mouse Mode Another Device Through a 2.4G USB Receiver,No Need to Install any Driver,Plug and Play;Wireless/Bluetooth Technology Provides Powerful and Reliable Connection,Which Can Enables Fast Data Transmission Without Delays or Dropouts,Effective Up to 10 Meters(33 feet)of Range
  • 【Silent/Fingerprint-proof】:Silent Laptop Mice Button Silent Click Design Reduces 90% Noises,Help You Concentrate on Your Work、Study Without Disturbing Others Besides You;Apple Mouse Fingerprint-proof Surface Coating Technology Design Gives Your a Skin-Like Touch,The sturdy anti-slip rubber scroll wheel ensures that your hand will not slip when scrolling;Slim Mouse Offers Your Hand Maximum Support and Comfort
  • 【Wide Compatibility Wireless Mouse】:Wireless Bluetooth Mouse For Laptop/Computer/Apple/Notebook/Tablet/Macbook/ipad/iPhone;Mice is Compatible With Android/Chromebook/Windows/Vista/Linux/Notebook/Mac OS and Other Bluetooth Devices

For publication, move the WordPress files and database to production-ready hosting, configure HTTPS, apply updates, restrict administrative access, and establish backups. Apache Friends provides a separate migration guide for moving a XAMPP WordPress site to production-ready hosting. Treat migration as a new security and operations project, not as simply exposing your laptop to the internet.

How should I maintain this local installation?

  • Keep XAMPP, PHP, MariaDB/MySQL, WordPress, themes, and plugins compatible and updated within your development policy.
  • Export the database and copy wp-content before major upgrades.
  • Use separate database names and users for separate projects.
  • Stop services when you do not need them, especially on a shared Windows computer.
  • Document any non-default Apache port so links, test scripts, and WordPress URLs remain consistent.
  • Never treat a local administrator password or database credential as disposable if the files might later be migrated.

How we chose this workflow

This sequence follows the documented XAMPP Windows workflow: use the installer or archive distribution, serve content from htdocs, manage Apache and the database through the Control Panel, use Administrator privileges for service registration, and verify with localhost. The WordPress steps follow its official package, database, configuration, file-placement, and browser-installation sequence. PowerShell is limited to transparent file and diagnostic helpers because the supplied documentation does not validate one universal automation script for every current XAMPP and Windows combination.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Can I install more than one WordPress site in XAMPP?

Yes. Put each site in its own subdirectory under htdocs, create a separate database and user for each, and open each site with its own localhost path. Separate credentials make troubleshooting and later migration safer.

What happens if I move the XAMPP folder after installing WordPress?

Archive-based XAMPP installations may need the package’s setup script after a path change, and service registrations can still point to the old location. Recheck the Control Panel, service entries, Apache configuration, and WordPress URLs before assuming the move succeeded.

Does a local WordPress site need HTTPS?

WordPress lists HTTPS among its current hosting recommendations, but a basic localhost development site commonly begins over HTTP. Test HTTPS-dependent features separately and do not mistake local HTTP for a production security configuration.

Where are my local WordPress files and content stored?

Core files and uploads are under your project directory in htdocs, with uploads normally inside wp-content. Posts, settings, users, and other structured data are in the database, so backing up only the files is incomplete.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply. Prices as of November 22, 2026 8:07 am GMT+0530.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.