How to install WordPress with XAMPP on Windows

|

,

|

The article outlines how to install WordPress on Windows using XAMPP. Crucial steps include downloading the XAMPP Package, installing XAMPP, and configuring it. Once the system is set up, a WordPress database must be created with the necessary credentials. Then, WordPress content can be downloaded from its official page and extracted. The process concludes with…

This article describes the steps to install WordPress on Windows with XAMPP support.

There are several reasons why someone might want to install WordPress with XAMPP on Windows. Firstly, it allows you to create a local testing environment to develop and test your WordPress site before deploying it to a live server. This can be particularly useful for developers experimenting with different themes, plugins, and custom code without affecting their live site.

Secondly, it provides an alternative to the traditional LAMP or LEMP stack typically used to run WordPress. While most WordPress sites are hosted on Linux servers, there are some situations where a Windows server might be more appropriate, such as when you need to integrate with existing Windows-based infrastructure.

Finally, XAMPP is a free and relatively easy-to-use software package that includes all the components you need to run WordPress on your local machine, including Apache, MySQL, PHP, and Perl. This means you don’t need to install and configure each component separately, which can save you time and effort.

How to install WordPress on Windows with XAMPP support

As described above, 99% of the time, WordPress will be installed on a Linux system, including Ubuntu, with either the LAMP or LEMP stack.

However, some open-source projects enable installing WordPress on Microsoft Windows desktops and servers today.

Below is how to install WordPress on Windows.

Download XAMPP Package

To install XAMPP on Windows, download the Windows version to the Apache Friends website.

Install XAMPP

After downloading the Windows version, you should be prompted to install the package. Next, you’ll need to install Apache, MySQL, PHP, and Perl, as shown in the image below. Complete the installation and continue to the next step.

Accept the default installation directory: C:\xampp.

Configure XAMPP

Now that the package is installed, open XAMPP and start up Apache and MySQL services, as shown in the image below.

After starting Apache2 and MySQL, these servers should be running. To test whether Apache is running, open Internet Explorer on the host machine and type the URL below:

http://locahost

This should bring up the Apache XAMPP default page.

To validate that MariaDB is installed and functioning, open the Shell command prompt on the right of the XAMPP Control Panel. This should launch the command shell. Then type the commands below:

mysql

This should get you onto the MariaDB database server.

To secure the MariaDB database server, open the Shell command windows again, then type the commands below.

perl\bin\perl.exe mysql\bin\mysql_secure_installation.pl

When prompted, answer the questions below by following the guide.

  • Enter current password for root (enter for none): Just press the Enter
  • Set root password? [Y/n]: Y
  • New password: Enter password
  • Re-enter new password: Repeat password
  • Remove anonymous users? [Y/n]: Y
  • Disallow root login remotely? [Y/n]: Y
  • Remove test database and access to it? [Y/n]:  Y
  • Reload privilege tables now? [Y/n]:  Y

Create WordPress Database

While still in the Shell command windows, type the commands below to log on to the MariaDB database server. Type the password you enter above when prompted.

mysql -u root -p

Then, create a database called wpdb

CREATE DATABASE wpdb;

Create a database user called wpuser with a new password

CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'new_password_here';

Then, grant the user full access to the database.

GRANT ALL ON wpdb.* TO 'wpuser'@'localhost' IDENTIFIED BY 'user_password_here' WITH GRANT OPTION;

Finally, save your changes and exit.

FLUSH PRIVILEGES;
EXIT;

Download WordPress Content

Now that the WordPress database has been created, download WordPress content from its download page.

After downloading the WordPress file, extract it into the C:\xampp\htdocs

You can delete all the files and folders and extract WordPress content from that folder. The htdocs should look like this:

When done, open Internet Explorer and type

http://localhost

This time, you should see the WordPress default setup page.

Type in the database connection info and continue

Create a WordPress admin account and continue

After installing, log on to the WordPress admin dashboard.

~Enjoy!


Discover more from Geek Rewind

Subscribe to get the latest posts to your email.

Like this:



7 responses to “How to install WordPress with XAMPP on Windows”

  1. Samuel Wood Avatar
    Samuel Wood

    Thank you so much for this. It was exactly what I needed

  2. Artu Avatar
    Artu

    Concise, clear, and to the point. Thanks for this great write-up.

  3. sanju Avatar
    sanju

    Unable to connect to the server as root user, giving up.
    Cleaning up…
    error occured

  4. Raunak Deb Avatar
    Raunak Deb

    No matter how many times I click shell command in the Control Panel the command window just doesn’t show up.Does it take a lot of time to show up or is there any other problem?I am running xampp on windows 10.

  5. Yuri Mednikov Avatar
    Yuri Mednikov

    Hello! Thanks for your post – I’ve used when I decided to start with WP locally. One remark – maybe it would be better to use phpMyAdmin to create db and user, than CLI?

  6. hotwoman Avatar
    hotwoman

    I have my website running on local xampp server on windows 10 system I want to move to my new Mac pro computer how do I do it? thanks.

    1. Dean Edwards Avatar
      Dean Edwards

      I have tried this install several times. It always fails at the same point right after you put the DB info in and it is accepted. Then I get a fatal error. I made sure the Define
      WP_CONFIG_PHP is set to true.
      The tables were created, it brought up a logon box but it just kept saying the user ID or PW was incorrect. Not sure what to do now.

      Thanks
      Dean Edwards

Leave a Reply to hotwoman Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.