How to Install a Web Server on Your Local Machine

Install XAMPP local host with PHP & MySQL

This tutorial is part 1 of a 3-part Guide to Installing WordPress Locally. WordPress requires a web server with PHP 5.2.4+ and MySQL 5.0 database in order to run. This article shows you how to get all three together by installing XAMPP to your computer. Note that XAMPP creates a local web host on your machine that is accessible only on your computer. If you want to access the website from every internet-connected machine, you need a hosting provider. 

What is XAMPP?

In short: X(cross-platform) A(Apache) M(MySQL) P(PHP) P(Perl) is a free and open source cross-platform web server solution that is very easy to install and use for local WordPress installations. Install and start using XAMPP by following these steps:

First, download XAMPP to your computer. You can get the latest version of XAMPP at http://sourceforge.net/projects/xampp.

When you run the xampp.exe file (assuming Windows), you might see a warning like this:

XAMPP Antivirus Question
XAMPP Anti-virus warning is nothing to worry about

This is not an issue and once you install the software it will run just fine, so choose 'yes' to continue with the installation.

On Windows 7+ machines, you might get another warning while installing XAMPP, even if you are logged in as an administrator:

XAMPP User Account Control on Windows
XAMPP on Windows 7+ may give User Control Warning

Since we plan to install XAMPP in the root of a drive, this should not be a problem. So click 'ok' and you will see the XAMPP installation startup screen.

XAMPP Setup Wizard
Start XAMPP Installation

Next you will be asked to choose from a number of options. As the expanded name of XAMPP indicates, it comes packaged with a mail server (Mercury) & Perl, and it can also install Tomcat (a server used to deliver Java applets) if you need. Since we only require PHP & MySQL to run WordPress, we can choose to deselect those options. However, do note that XAMPP will tell you every time you boot it that Mercury and Tomcat were not found. If you want to avoid that, you can simply click 'Next' without deselecting anything:

XAMPP installation setup options
You need Apache, MySQL, PHP & PHPMyadmin to install WordPress

Next you will be asked to choose a folder to install into. XAMPP works from anywhere, but the recommended folder is the root of your C: drive, and since this is easy to remember and safe to access, we can continue with the installation here:

Where to Install XAMPP
Specify destination folder for xampp install

Then it will be a bit of a wait while XAMPP installs all the necessary components on your computer:

XAMPP Installing
Installation takes several minutes, be patient!

Once it is completed, navigate to the directory C:\xampp and double-click on xampp-control.exe to start your web server. This is an important step that you will do whenever you want to start up your Apache web server to start using WordPress on your machine. When the control terminal opens, start Apache and MySQL. (Don't worry about warnings regarding Mercury or Tomcat in the xampp-control terminal, we won't be using those.)

Startup XAMPP server and database
Start the indicated components

Now you can close the control panel window (don't click 'quit', just close it from the top right), open a browser tab and type in 'localhost/'(no www- or  extensions like .com) or click here: http://localhost/ If all went well and Apache is working, you will see the following screen:

XAMPP Success Splash Screen
XAMPP is working!

This means XAMPP is successfully installed. Well done, your computer can now act as a web server whenever you want! You can also check that PHP/MySQL was successfully installed by visiting the /phpmyadmin directory at http://localhost/phpmyadmin

The important thing to remember at this point is that the 'localhost' on XAMPP serves files from the 'htdocs' directory inside xampp's main folder. This means that any files you put in C:\xampp\htdocs folder (assuming you installed xampp to C:) will now be accessible from that path at localhost. Now that all is working well, let's move on to creating a MySQL database for WordPress.

Share:

Post Comment

Tags allowed: <a>,<strong>, <blockquote>.