• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • About
  • Fav Books
  • Tools
  • Journal
  • Hire Me
  • Contact
Small Biz Geek

Small Biz Geek

Small Business Design, Marketing & Technology Journal

Website design services

A Journal on Small Business Design, Marketing and Technology

  • The Internet
  • Marketing
  • Graphic Design
  • Web Dev
  • Web Design
  • Social Media
  • Technology
  • Miscellaneous

WAMP Server Stack: localhost for Development and Testing

You are here: Home / Darren’s Small Business Tools / WAMP Server Stack: localhost for Development and Testing

WAMP Server Stack

WAMP, also known as WAMPserver is a free localhost server stack comprising Apache, MySQL and PHP for Windows. It is ideal for learning, testing and developing websites without having to use a remote web server.

I use WAMP personally and professionally for my WordPress websites because it allows me to experiment with code, design, plugins and frameworks all within the safety of what you could compare to a sandbox.

In my opinion, it is dangerous to do major maintenance tasks on a live website. The larger the website, the more there is to lose. If you don’t like nasty surprises, use a localhost.

Death star

Developing your site in a safe environment means there can be no inconveniences. WordPress websites are particularly vulnerable to attack on a remote server – more so when you’re rebuilding or repairing parts of it live.

WAMP acts kind of like a shipyard and a pit stop.

Build out your site and launch when ready. Clone a copy of your live site and examine it. Share a project with a team of developers. There’s so much you can do and it costs nothing.

Why I Like WAMP

WAMP has become my preferred localhost software because it can handle multiple installations of WordPress. Of course, you can install whatever content management system you like, whether it be Drupal, Joomla or Magento. Or you might not want to use any type of CMS at all.

WAMP www folder

When I started using WordPress a few years ago the localhost I used exclusively was InstantWP because it is free, requires no installation and is “portable”, meaning you can copy it to USB flash drives and run the software directly off the drive. 

Instant WP: Build & Test WordPress Sites Offline

InstantWP is good for smaller websites and handy when meeting clients and demoing a WordPress website because it can be run quickly. (You’ll need to configure the software to use their browser though.)

WAMP has better stability and is more widely supported. If you tend to do all your development on one computer it’s arguably a better choice. 

It requires installation from either a 32-bit or 64-bit .exe. 

Preparing to InstallWAMP

While you can install any CMS you want, I’m going to go with WordPress.

You might not actually want to install a CMS, which is fine. If you have HTML or PHP webpages, these can be used instead.

If you already know that you don’t need to install a MySQL database, ignore the parts of this guide about phpMyAdmin and databases.

Disable any firewalls, at least during installation.

Also make sure you disable Microsoft IIS, and be sure to install all the neccessary Microsoft Visual C++ packages, as WAMP may not work at all.

The WAMP website has a page with all the versions of VC++ you might need, plus a handy tool for checking which ones are not yet installed.

1) Download WAMP

Visit http://www.wampserver.com/en/ and scroll to the Downloads section.

You have the option of either a 32-bit download or a 64-bit download.

If you’re unsure what kind of operating system you’re running, you can safely download and install the 32-bit exe on any Windows 7 OS. Use the Windowss command msinfo32 to get a quick overview of your system and determine whether you’re on 32 (x86) or 64 (x64).

I’ve recently installed WAMP 3.2.0 as it comes with several iterations of the latest PHP 7 which is needed for the recent WooCommerce software updates.

If you have Windows 8 or Windows 10 I’m afraid I cannot help you although the WAMP forums might offer the right information.

To be sure about the type of operating system you’re running, click the Start button, right click Computer and choose Properties.

From there you can get the information about your Windows 7 installation.

Windows 7 Computer Properties

Before you can download your chosen WAMP installation package, a popup like that below will warn you about compatibility with older versions of the software.

WAMP has since been updated so it will be a little different in so much as the version numbers will have changed.

Click the orange “download directly link” and choose a location and save the package when prompted..

WAMP warning

2) Install .exe

Double click the setup file. If you experience the warning message in Windows 7 informing you the software lacks a valid security certificate, you can ignore this.

It is safe to run the software. Also, the screenshots below only serve as a guide, since we’re well into version 3 now.

WAMP Security Certificate

Next you’ll see the setup wizard welcome screen with details on the exact versions of what will be installed as part of WAMP.

WAMP Setup wizard

Follow the on-screen prompts and decide what location you’ll use for the software. By default it uses C:\wamp\ but you can change this.

WAMP Installation Ready

WAMP Installation

The software will install and then you’ll be prompted to choose what browser to use. By default it suggests Internet Explorer (bad idea!).

When prompted, navigate to your preferred browser.

Choose browser for WAMP

Next, you’ll see a window asking for PHP mail settings. You can leave the defaults settings.

WAMP PHP Mail Settings

You’ll see a message telling you the setup wizard has completed. Now you can click finish.

WAMP Installation complete

Missing File Error During Installation?

If you get a message telling you that vcruntime140.dll is missing, you might need Microsoft Visual C++, so download the latest version of that.

You can the Visual C++ 2015 version here. Uninstall WAMP fully first and restart your PC.

3) Prevent Port 80 Skype Conflict

Before you launch WAMP, I should point out there are conflict issues with Skype. 

Skype conflicts with WAMP because they both try to use port 80 by default.

If you are running Skype (the classic 7.41 version), let me share a quick tip that will allow you to run it at the same time as WAMP without any problems.

Open Skype and click Tools > Options > Advanced > Connection

Uncheck the box titled Use port 80 and 443 for additional incoming connections

Disable port 80 in Skype

You might want to restart your computer at this point.

4) Configuring WAMP

You can launch the software by searching for WampServer in the Windows 7 Start Menu.

Launch WAMP from Windows 7 Start Menu

Click the icon and direct your attention to the Windows system tray on the lower far right side of your computer monitor.

You should see a green “W” icon. 

WAMP System tray icon positionIf you do not see the icon at all, it might be hidden in the mini flyout menu denoted by the small arrow.

You can drag and reposition the “W” icon in your system tray.

When you launch the software, the icon should turn green, but often it will not.

Sometimes it will jump straight to green, other times it will slowly change to green through red and amber.

Startup WAMP services

Red is bad, amber is bad, green is good.

Seeing the green icon indicates all services have successfully started and most of the time this will be the case.

But what if your icon is stuck on red or amber?

Red or Amber Icon

A red icon means something is blocking port 80. Try the Skype tip I mentioned. If you’re running a firewall or antivirus software, try disabling it.

An amber icon colour means the Apache services have not started. 

You could try the Restart All Services option. This is the first thing I try when I need to refresh everything.

Restart all Services

If this does not work, try Apache > Service > Start/Resume Service

WAMP Apache Services

Still no change?

Here’s another suggestion: change the port number used by WAMP in the httpd.conf file.

Click Apache > Services > httpd.conf

WAMP Apache http.conf

Search httpd.conf using CTRL & F.

Locate the three occurences of :80 and change them to :8080

This is what you’re looking for:

Listen 0.0.0.0:80

Listen [::0]:80

ServerName localhost:80

If you do change the port number in httpd.conf you will have to manually add :8080 to all your urls including localhost/

Your development server homepage will be something like localhost:8080/

Why is WAMP “Offline?”

If you’re using WAMP “out-of-the-box” you will be using it “offline”. Don’t let this confuse you. 

This is the default operating mode and is no way indicative of an error.

WAMP server OFFLINE

Setup Permalinks for WordPress

Assuming you want to build a WordPress site, there’s something we need to enable under the Apache settings.

It’s the permalinks settings. 

These are controlled by the rewrite_module. Make sure this is checked.

Click the green icon and choose Apache > Apache modules > rewrite_module

By default this is unchecked, so always check this option in any new installation of WAMP.

WAMP Apache rewite_module

At this point the green “W” icon in your system tray will turn amber then back to green while the Apache services reboot.

www Directory

The www directory is installed to C:\wamp\www\ by default. You can access this quickly via the WAMP menu in the system tray.

WAMP www directory

Create a new folder in the www directory and call it anything you want. 

For the purposes of this guide I’m calling the new folder “test”.

5) Accessing localhost

The URL localhost/ is the address of your offline testing environment. When your site is uploaded to your host you change all occurrences localhost/ to your domain name.

To open up the localhost homepage, click the green “W” icon in your system tray and choose Localhost.

WAMP Access to Localhost

You will be presented with the localhost homepage in a new browser window.

It looks something like the following screenshot. Notice the “test” folder has appeared here, under Your Projects:

WAMP localhost homepage

6) Installing WordPress

Because we’re going to download and install the latest version of WordPress, we first need to set up a new MySQL database.

WAMP comes with phpmyadmin (a database management tool with a graphic user interface). This particular tool is not everyone’s cup of tea when it comes to databases, but it IS pretty common. I can tolerate it. 

Setup Database for WordPress

Let’s get started by creating the database inside WAMP using phpMyAdmin.

Visit localhost and click the blue phpmyadmin link. Alternatively, use the menu from the system tray icon to access phpmyadmin.

Access PhpMyAdmin on localhost

The phpMyAdmin interface will open. Click the Databases tab.

Create new database

Now create a database, giving it a name of your choosing. You can call it anything you want.

If you use uppercase characters, they’ll automatically be come lowercase when the database is created.

Name database

Download & Configure WordPress Package

Download the latest version of WordPress from WordPress.org.

Once you’ve downloaded it, unzip the archive and copy all files to C:\wamp\www\test\

WAMP WordPress directory in www folder

Next, open C:\wamp\www\test\wp-config-sample.php

Use WordPad (comes with Windows) or Notepad++ (free, open source, excellent).

WordPress localhost wp-config

Locate the following lines:

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'database_name_here');

/** MySQL database username */
define('DB_USER', 'username_here');

/** MySQL database password */
define('DB_PASSWORD', 'password_here');

/** MySQL hostname */
define('DB_HOST', 'localhost');

Change the the database name and the database username as shown below:

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'smallbizgeek');

/** MySQL database username */
define('DB_USER', 'root');

/** MySQL database password */
define('DB_PASSWORD', '');

/** MySQL hostname */
define('DB_HOST', 'localhost');

FYI – with any new 'localhost', the username is always 'root' and the password is blank, indicated by the '' characters.

Save the changes to wp-config-sample.php and close. Rename it to wp-config.php

Rename wp-config

Now open localhost/test/wp-admin/install.php or just visit localhost/test/

You’ll be presented with the WordPress installation screen.

Add a site title. Enter a strong username and strong password.

Make a note of these credentials and keep them safe.

WordPress installation screen

You are now done.

Check the front page to see everything is working.

If you get a database error screen, it’s most likely that you’ve mistyped the name of your database in wp-config.php

WAMP WordPress front page

To login to your WordPress dashboard, type localhost/test/wp-admin/

When you eventually move your website online (which I’ll talk about another time) localhost/test/ will be swapped out for http://www.yoururl.com/

Backing Up WAMP

One thing that is useful to know is how to backup your WAMP server.

You can, of course, log into the localhost phpMyAdmin and export your databases as .SQL files. (By the way, are you getting logged out of phpMyAdmin? Here’s how to hard code the username so you never have to go through the login screen when the session expires.)

You want to regularly make copies of the all-important www directory as well as the MySQL folder containing the databases.

I say this because I recently had to reformat another machine that had WAMP installed. Before wiping everything I copied the entire C:\wamp\ folder to my external USB drive.

Upgrading WAMP to a Later Version

It’s possible to upgrade the software to a later version. Rather than do that, I installed the newest version separately and in its own folder. 

There are now two shortcuts pinned to my Windows Start Menu.

WAMP start menu shortcuts

I copied the contents of the www folder (the directory files) and the entire data folder (the database files) into the corresponding locations in the newer installations.

This is the safest way to run it as far as I am concerned. There are/were some discussions on the WAMP forums about installing the latest version.

Change URLs without Breaking Serialised Data

Once you start cloning and migrating sites that use a MySQL database, you’ll need to know how to change all instances of URLs in the database.

The following examples are common:

  • You need to change localhost/test/ to localhost/testing/
  • You upload to a remote server and need to change localhost/test/ to www.yourwebsite.com/
  • You clone a site on a remote server and must change www.yourwebsite.com/ to localhost/test/

If you know how to use SQL queries, you can go into phpMyAdmin and run some manual commands that replace all URLs.

There’s an easier way.

There’s a tool that won’t break the serialised data (aka the hardcoded data about length of a URL inside an SQL file) and it’s free.

It’s a script called Search Replace DB Master. It is placed in the root directory of your WordPress installation, either on a local or remote host.

You load it in your browser and search your database for all instances of a particular URL to change it to a new one.

Watch video on YouTube

The video does mention the fact that you need to manually change the two rows under wp_options. 

If you look in the comments, you’ll see I made a comment about this:

YouTube comment

Analysis

It’s free, it’s powerful and it’s not just for WordPress. WAMP is going to be my localhost of choice for a long time. 

The benefits for me are peace of mind. Knowing what I can do in terms of development and testing gives much confidence and plenty more options. 

Primary Sidebar

About the Webmaster

Hello, my name is Darren, a 36-year-old business enthusiast eager to learn and do good work.

I’m a website builder for hire working with small to medium businesses.

Search Website

Let’s Connect

  • LinkedIn
  • Twitter
  • YouTube

Recently Read Book

Don't Make Me think - Steve Krug

“Don’t Make Me Think: Revisited” – Steve Krug (Book Review)

A person of average technical ability must be able to navigate your website easily. This is required reading for anyone wanting to create a better experience for their visitors…

Latest Journal Entries

  • Computer Says No: Does Your Website Work for People with Disabilities?
  • Chinese Tinder Profiles Are Using Photos of Pretty Girls to Scam “Investors”
  • Small Biz Owners “Trapped” Using Email Addresses Belonging to Internet Service Providers
  • In the Pandemic, QR Codes are Finally Proving Worthy in the West
  • Small Businesses Finally Start Marketing and All It Took Was a Global Pandemic
  • Unable to Meet in Person? Communicate Stress-Free with Online Audio/Video
  • UK Contractors Operating Ltd Companies Should Be Mad as Hell with HMRC and IR35
  • 20 Years On and Website Hit Counters are Still a Waste of Pixels
  • Competitors Can Easily Edit Your Google and Facebook Business Listings
  • Waiting on Final Images for a WordPress Website? Use Temporary Placeholders and Design Around Them
  • GoDaddy Loves Spamming Branded Footer Links to WordPress Installatron Sites
  • Dealing with Negative Comments on Your Paid Social Media Posts

Footer

Primary Navigation

Home
About Darren
Good Books
My Tools
Blog Posts
Hire Me
Contact Me

Secondary Navigation

The Internet
Marketing
Graphic Design
Website Development
Website Design
Social Media
Technology
Miscellaneous

Derby & Nottingham Area

Small Biz Geek
Office 897
109 Vernon House
Friar Lane
Nottingham
NG1 6DQ

Telephone

Tel: +44 (0) 115 714 3290
Tel: +44 (0) 7951 897 243

VoIP

Skype: ilkestonwebdesign
WhatsApp: 07519 897 243

Email

[email protected]

Let’s Connect

Twitter
YouTube
LinkedIn
RSS

Subscribe to Blog by Email

Subscribe to Blog By Email

Social Calendar

WordPress Nottingham Meetup
WordPress Derby Meetup
Genesis Framework by StudioPress


Copyright © 2021 · Small Biz Geek · Privacy Policy · Commenting Policy · Website Disclaimer · ICO number: ZA305900


Written and designed by Ilkeston Web Design

This site uses cookies More info