Working Offline – What To Do When You Have No Internet

Working Off-line Can Be Frustrating, But Doesn’t Always Have To Be

This is always a problem while traveling and yes this can and will be a problem at some point in your travelpreneur future.  At some point we all get to the beach and look for that hotspot or WiFi that you can just get a few thing up on your site…..but no luck.  There will not always be the luxury of having a connection when you are on the move.  As any seasoned blogger or travelpreneur will tell you, it’s just the way it is.

I have come to offer you a bit of resources here to make this step not so painful.  Let’s say you just had a stellar day at the office, better known as the beautiful beach side resort on an amazing tropical island, to find you have no way to post all of your pictures and write about your day’s events.  Well, there is an easy way around this to get you through until you DO have that connection that you need to continue on your journey of letting the world know what you are up to.  It’s called XAMPP, and I have been using this for a few years now and works AWESOME!!

The idea behind XAMPP is that you are essentially installing a mini-server on your computer and installing wordpress onto that.  If you already have a well established wordpress site and think its going to be a huge pain in the butt to get it all sync’d up, you’re kinda right but it’s actually not that bad.
Side note: you can run this on mac or pc and yes for sure a laptop.

 

Let’s get started with the basics, getting it installed and running.

How to Install WordPress for Offline usage using XAMPP

1) Download Xampp from the official website Apachefriends.org (side note here:  download the newest possible version)

The XAMPP file 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.

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 greyed 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.

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

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

Since we’re going to install WordPress manually later in this turorial 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 finally ready to install. Click Next.

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.

The Control Panel will automatically open, but if you unchecked the option in the prevous window, you can go to the XAMPP folder on you 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 conflict.

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.

To stop the service running, do the following:

  1. Go to Start, type in “services.msc” and select the best match
  2. Scroll down in the Services window to find 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 firewall rule to forceably 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 field below for Specific 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 field, 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/firewall 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.

Running XAMPP

Now, let’s see if everything works smoothly.

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

Both services are running fine. Excellent!

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

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.

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

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.

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:/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.

Open the WP folder where you saved WordPress, find the wp-config-sample.php file and rename it wp-config.php. Open the file and scroll down until you see the following lines:

These lines of code define the login details for your database:

  • Replace“database_name_here” with the name of your database, which in my case is “WP”
  • Replace “username_here” with “root” and leave “password_here” blank
  • Save the file 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 five minute WordPress installation process.

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

Your WordPress installation is now complete!

Now here is where you can either say “I’m done” or “I need more!”  What I mean by that is that if you want to work on more sites offline than continue, if not…..you’re done!

Setting up WordPress Multisite

Having Multisite setup locally provides an efficient 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.

Open your wp-config.php file again and add/edit the following lines to activate Multisite’s installation mode:

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-config.php and .htaccess files.

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

Next, open .htaccess. If you can’t find it, make sure hidden files are displaying on your computer. If you do not have a .htaccess file already, then create it in the same directory as your wp-config.php file. If you do have a .htaccess file, replace any existing lines with these new ones:

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 or Mac machine, allowing you to work from anywhere and then upload it when you can or are ready. 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 if you want to see what each individual one does.

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.

 

If you find any trouble with installing WordPress using XAMPP,  let me know via comments. If you find this article useful, then share it on Facebook and Twitter please!

If you find any errors in installing or have any queries please post them as comments below.

 

>