0% found this document useful (0 votes)
53 views

How To Install XAMPP and WordPress Locally On PC - Windows - WPMU DEV

The document provides instructions for installing XAMPP and WordPress locally on a Windows PC. It details downloading and installing XAMPP, and describes how to fix common errors like port conflicts that may occur. The document then explains how to install WordPress on the local XAMPP server.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views

How To Install XAMPP and WordPress Locally On PC - Windows - WPMU DEV

The document provides instructions for installing XAMPP and WordPress locally on a Windows PC. It details downloading and installing XAMPP, and describes how to fix common errors like port conflicts that may occur. The document then explains how to install WordPress on the local XAMPP server.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

June 29, 2018 ª 122 Comments

Raelene Morey

How to Install XAMPP and


WordPress Locally on PC/Windows

S etting up XAMPP on your Windows machine is by far


no easy feat, let me tell you! But once it’s installed,
it’s a breeze to run and will save you a bunch of time if you
need to run WordPress locally. In fact, you’ll forget it’s
even there.
Having a localhost environment is an essential part of my WordPress work ow – I couldn’t do
my day job without it. I regularly set up new installs of WordPress to test and play with new
versions of themes and plugins, and I have multiple Multisite installs set up, too.

Note: If you're still having trouble setting up XAMPP, let us help! Our
awesome support team can help you with any WordPress issue, big or small
– and for free! It doesn't matter what time it is or whether it's the weekend,
our team is available 24/7. Check out our Support page to nd out more.

The great thing about running a localhost install is that your test site will run much more quickly
than it otherwise would online, but if you want to ensure it continues to run at optimal speed, be
Our site uses cookies. By continuing to use our site you are agreeing to our  Cookie Policy. OK, I
sure to install and activate Hummingbird on your install.
understand
TRY FREE FOR 30 DAYS ¯

https://premium.wpmudev.org/blog/setting-up-xampp/ 1/74
20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

A localhost installFREE!
is also more secure and provides an ideal testing environment on your
WP Checkup
by wpmudev
computer, away from prying eyes or hackers.

We originally published a version of this post in mid-2014 and it quickly became one of our top
10 posts with well over 150 comments. Since then, XAMPP 5.6.15 is now available and Windows
itself has undergone a few updates. So here’s a shiny new updated guide on how to set up
XAMPP on Windows, with added information on how to get around pesky rewall and port
issues.

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.

Since XAMPP is cross-platform, it also works on Mac and Linux, but today we’re going to focus
on how to set up XAMPP on Windows 10.

WordPress isn’t a stand-alone application and requires server software in order to run. XAMPP
provides the necessary environment needed to run WordPress on a local machine.

Installing XAMPP
Go to the Apache Friends website and download XAMPP.

Our site uses cookies. By continuing to use our site you are agreeing to our  Cookie Policy. OK, I
understand
TRY FREE FOR 30 DAYS ¯

https://premium.wpmudev.org/blog/setting-up-xampp/ 2/74
20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

FREE!
WP Checkup
by wpmudev

The Apache Friends website.

The XAMPP le is 109MB. Once downloaded, launch the installer.

During the install process, you may receive warnings such as Windows asking you if you’re sure
you want to install the software and the installer prompting you about antivirus software. As you
would when installing any software on Windows, use your best judgment, but you probably want
to click “Yes” to continue with the install.

The XAMPP setup wizard will guide you through the installation. Click Next.

Our site uses cookies. By continuing to use our site you are agreeing to our  Cookie Policy. OK, I
understand
TRY FREE FOR 30 DAYS ¯

https://premium.wpmudev.org/blog/setting-up-xampp/ 3/74
20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

FREE!
WP Checkup
by wpmudev

In the next window, you will be asked to select which components of the software you would like
to install and which ones you don’t want. Some options, such as Apache and PHP are essential
to running the software and will at automatically installed, so they are grayed out so you can’t
select them.

It’s up to you which components you want to install. Since we want to run WordPress in our
localhost environment, leave MySQL and phpMyAdmin checked and uncheck the remaining
options.

Our site uses cookies. By continuing to use our site you are agreeing to our  Cookie Policy. OK, I
understand
TRY FREE FOR 30 DAYS ¯

https://premium.wpmudev.org/blog/setting-up-xampp/ 4/74
20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

FREE!
WP Checkup
by wpmudev

Next, select the folder where you would like to install XAMPP on your machine. I’m going to
create a new folder in C:\Program Files\XAMPP.

Our site uses cookies. By continuing to use our site you are agreeing to our  Cookie Policy. OK, I
understand
TRY FREE FOR 30 DAYS ¯

https://premium.wpmudev.org/blog/setting-up-xampp/ 5/74
20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

In the next window, you’ll be asked whether you would like to install Bitnami for XAMPP, which
FREE!
WP Checkup
offers by wpmudev
free tools for installing WordPress, Drupal, and Joomla! on top of XAMPP.

Since we’re going to install WordPress manually later in this tutorial and don’t need free installers,
untick “Learn more about Bitnami for XAMPP” and click Next.

After going through all those initial installation steps, XAMPP is now nally ready to install. Click
Next.

Our site uses cookies. By continuing to use our site you are agreeing to our  Cookie Policy. OK, I
understand
TRY FREE FOR 30 DAYS ¯

https://premium.wpmudev.org/blog/setting-up-xampp/ 6/74
20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

FREE!
WP Checkup
by wpmudev

Once installed, you’ll be asked whether you would like to start the XAMPP Control Panel, which
provides an interface for running your localhost environment. Leave this option ticked and click
Finish.

Our site uses cookies. By continuing to use our site you are agreeing to our  Cookie Policy. OK, I
understand
TRY FREE FOR 30 DAYS ¯

https://premium.wpmudev.org/blog/setting-up-xampp/ 7/74
20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

The Control PanelFREE!


will automatically open, but if you unchecked the option in the previous
WP Checkup
by you
window, wpmudev
can go to the XAMPP folder on your computer and open XAMPP Control Panel
instead.

If the installation process went well and everything is running smoothly, the control panel will
open with black and blue text updates at the bottom. But if there are issues…

… Well, look at that – red text! It looks like I’ve run into some errors already. Not to fear, it looks
like a port con ict.

Fixing Port Errors

The main reason why XAMPP throws up errors like this is due to another program on your
machine using ports 80 or 443 – the ports Apache and MySQL need in order to run.

If you’re using Windows 10, World Wide Web Publishing Service is most likely using post 80. This
program, which is for Internet Information Services (IIS) for Windows® Server, comes pre-
installed and if you’re not using it, you can simply stop the service running on your machine or
even delete it.
Our site uses cookies. By continuing to use our site you are agreeing to our  Cookie Policy. OK, I
understand
TRY FREE FOR 30 DAYS ¯

https://premium.wpmudev.org/blog/setting-up-xampp/ 8/74
20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

To stop the service running, do the following:


FREE!
WP Checkup
by wpmudev
1. Go to Start, type in “services.msc” and select the best match

2. Scroll down in the Services window to nd World Wide Web Publishing Service

3. Right-click on it and select Stop

4. This should free up port 80. When you restart XAMPP it should run without errors

If that doesn’t resolve the issue, you can set up a new rewall rule to forcibly unblock the ports:

1. Open Windows Firewall on your machine and > click on Advanced Settings on the left

2. Click on Inbound on the left, then on the far right click New Rule

3. Click Port and then TCP. In the eld below for Speci c Ports type in “80, 443” and click Next

4. Check Allow the Connection then click Next

5. Make sure all options are checked and click Next

6. In the name eld, enter whatever you want, but for the sake of consistency let’s type in
LOCALHOST1. Click Finish

7. Now repeat steps 1-6, but name this new rule LOCALHOST2 and click Finish

8. Restart your computer

Ports 80 and 443 should now be open locally on your computer.

I should also mention at this stage that if you get any security/ rewall warnings while installing
or using XAMPP (such as the prompt pictured below), make sure you check “Private networks,
such as my home or work network” and click “Allow access.” This is very important. If you don’t
allow access, XAMPP won’t work.

Our site uses cookies. By continuing to use our site you are agreeing to our  Cookie Policy. OK, I
understand
TRY FREE FOR 30 DAYS ¯

https://premium.wpmudev.org/blog/setting-up-xampp/ 9/74
20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

FREE!
WP Checkup
by wpmudev

Running XAMPP
Now, let’s see if everything works smoothly.

If you previously quit the control panel to x a port issue, restart XAMPP. Then start up both
Apache and MySQL.

Our site uses cookies. By continuing to use our site you are agreeing to our  Cookie Policy. OK, I
understand
TRY FREE FOR 30 DAYS ¯

https://premium.wpmudev.org/blog/setting-up-xampp/ 10/74
20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

FREE!
WP Checkup
by wpmudev

You have no idea how happy I am to see both Apache and MySQL working, or maybe you do!

Both services are running ne. Excellent!

1.6 million WordPress Superheroes read and trust our blog. Join them and get daily
posts delivered to your inbox - free!

Your email address SUBSCRIBE

You can check if your new local server is installed by visiting http://localhost in your browser.

Our site uses cookies. By continuing to use our site you are agreeing to our  Cookie Policy. OK, I
understand
TRY FREE FOR 30 DAYS ¯

https://premium.wpmudev.org/blog/setting-up-xampp/ 11/74
20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

FREE!
WP Checkup
by wpmudev

Woohoo! Successfully set up.

Setting Up Your MySQL Database


Before we install WordPress, we need a database.

In your XAMPP Control Panel, click the Admin button in the MySQL section.

Our site uses cookies. By continuing to use our site you are agreeing to our  Cookie Policy. OK, I
understand
TRY FREE FOR 30 DAYS ¯

https://premium.wpmudev.org/blog/setting-up-xampp/ 12/74
20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

FREE!
WP Checkup
by wpmudev

Click on Admin in the MySQL row to launch phpMyAdmin.

A new browser window will automatically open with the phpMyAdmin interface.

Our site uses cookies. By continuing to use our site you are agreeing to our  Cookie Policy. OK, I
understand
TRY FREE FOR 30 DAYS ¯

https://premium.wpmudev.org/blog/setting-up-xampp/ 13/74
20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

FREE!
WP Checkup
by wpmudev

Click “Admin” to set up MySQL or go to “localhost/phpmyadmin” in your browser.

Click on Databases near the top-left, and you’ll be prompted to create a new database. I’ve called
mine “WP.”

When you’ve entered a name, click Create and close the window.

Our site uses cookies. By continuing to use our site you are agreeing to our  Cookie Policy. OK, I
understand
TRY FREE FOR 30 DAYS ¯

https://premium.wpmudev.org/blog/setting-up-xampp/ 14/74
20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

FREE!
WP Checkup
by wpmudev

Quickly and easily set up a new MySQL database for WordPress.

Download and Install WordPress


Download the latest version of WordPress.

In order to get WordPress working with XAMPP, we need to unzip WordPress in the right folder.
Go to the XAMPP folder on your computer and open the htdocs folder – C:/Program
Files/XAMPP/htdocs.

Unzip WordPress into its own folder and rename it whatever you like. For consistency, I’m going
to call this installation of WordPress “WP” to match the name of the database I just created.
Our site uses cookies. By continuing to use our site you are agreeing to our  Cookie Policy. OK, I
understand
TRY FREE FOR 30 DAYS ¯

https://premium.wpmudev.org/blog/setting-up-xampp/ 15/74
20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

FREE!
WP Checkup
by wpmudev

My installation of WordPress is called “WP.”

Open the WP folder where you saved WordPress, nd the wp-con g-sample.php le and rename
it wp-con g.php. Open the le and scroll down until you see the following lines:

Update your wp-con g.php le with your database details.

These lines of code de ne the login details for your database:

Replace“database_name_here” with
Our site uses cookies. By continuing the our
to use namesiteof
youyour database,
are agreeing which
to our  in my
Cookie case is
Policy. “WP”
OK, I
understand
TRY FREE FOR 30 DAYS ¯

https://premium.wpmudev.org/blog/setting-up-xampp/ 16/74
20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

Replace “username_here”
FREE! with “root” and leave “password_here” blank
WP Checkup
by wpmudev
Save the le and close it

Now we can get on with actually installing WordPress.

Open your browser and go to http://localhost/wp/

You should see the translation screen that comes before the famous ve minute WordPress
installation process.

Choose the language you want to use WordPress in.

Once you’ve chosen your language, continue onto the next screen and enter your username and
password details. Click Install WordPress.

Your WordPress installation is now complete!

Setting up WordPress Multisite


Having Multisite setup locally provides an ef cient way to test themes and plugins in a Multisite
environment, but also makes it a quick and easy to have multiple instances of Multisite set up.
Our site uses cookies. By continuing to use our site you are agreeing to our  Cookie Policy. OK, I
understand
TRY FREE FOR 30 DAYS ¯

https://premium.wpmudev.org/blog/setting-up-xampp/ 17/74
20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

Open your wp-conFREE!
g.php  le again and add/edit the following lines to activate Multisite’s
WP Checkup
by wpmudev
installation mode:

1
2 define('WP_DEBUG', false);
3
4 define('WP_ALLOW_MULTISITE', true);
5
6 /* That's all, stop editing! Happy blogging. */

enable-multisite hosted with ❤ by GitHub

view raw
Open XAMPP and ensure Apache and MySQL are running.

Login to your localhost site in your browser and under Tools you will now have a new option,
Network Setup.

Enter a name for your network and your email address, then click “Install.”

WordPress will prompt you to edit your wp-con g.php and .htaccess  les.

Following the onscreen instructions, open wp-con g.php and add the following lines underneath
your previous edit:

1 define('WP_DEBUG', false);
2
3 define('WP_ALLOW_MULTISITE', true);
4
5 define('MULTISITE', true);
6 define('SUBDOMAIN_INSTALL', false);
7 define('DOMAIN_CURRENT_SITE', 'localhost');
8 define('PATH_CURRENT_SITE', '/');
9 define('SITE_ID_CURRENT_SITE', 1);
10 define('BLOG_ID_CURRENT_SITE', 1);
11
12 /* That's all, stop editing! Happy blogging. */

setting-up-multisite hosted with ❤ by GitHub

Expand Code view raw

Next, open .htaccess. If you can’t nd it, make sure hidden les are displaying on your computer.
Our site uses cookies. By continuing to use our site you are agreeing to our  Cookie Policy. OK, I
If you do not have a .htaccess le already, then create it in the same directory as your wp-
understand
TRY FREE FOR 30 DAYS ¯
con g.php le. If you do have a .htaccess le, replace any existing lines with these new ones:
https://premium.wpmudev.org/blog/setting-up-xampp/ 18/74
20/02/2019 How to Install XAMPP and WordPress Locally on PC/Windows - WPMU DEV

1 # BEGIN WordPress
FREE!
WP
2
Checkup
RewriteEngine On
by wpmudev
3 RewriteBase /
4 RewriteRule ^index\.php$ - [L]
5
6 # add a trailing slash to /wp-admin
7 RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
8
9 RewriteCond %{REQUEST_FILENAME} -f [OR]
10 RewriteCond %{REQUEST_FILENAME} -d
11 RewriteRule ^ - [L]
12 RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
13 RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
14 RewriteRule . index.php [L]
15
16 # END WordPress

multisite-htaccess hosted with ❤ by GitHub

Expand Code view raw

Multisite should now be installed.

You’ll need to log in again, and when you do, you’ll see the WordPress dashboard from where
you’ll be able to access individual sites in your network.

Wrapping Up
XAMPP provides an easy way to run a local server environment on your Windows machine,
allowing you to test and develop locally, rather than installing WordPress on a live site. It will also
save you a bunch of time since you won’t have to install and uninstall WordPress each time you
test themes and plugins.

The great thing about XAMPP is it’s free and open source. You can set up as many installations
of WordPress as you want and it’s just as easy to get Multisite up and running.

Share on f t i

Our site uses cookies. By continuing to use our site you are agreeing to our  Cookie Policy. OK, I
understand
Do you use XAMPP? HaveTRY
youFREE
had FOR
trouble setting
30 DAYS ¯ it up or was it a breeze to install?

https://premium.wpmudev.org/blog/setting-up-xampp/ 19/74

You might also like