Have you ever had that pesky error message come up on your website after updating a plugin or trying to edit your theme?
Sometimes the error is easy to fix, other times your site is down for an hour or two while you try to troubleshoot what went wrong. Either way, it’s frustrating to have your site offline while you are fixing the problem. You are losing traffic and customers every minute that your website is unreachable.
If you’ve experienced the frustration of a bad plugin update or some accidental coding error in your theme, then you’re going to be interested in this post.
I’ve recently have been toying around with some tweaks to my theme. Now, I’m not a coder, so I’m basically learning css and php on the fly. Some of it is from reading online tutorials, and other times it’s by a little trial and error.
When you are making changes to your theme and sometimes experimenting by trial and error, you never want to do it on your live site. That can lead to disasterous results.
The solution is to run a test install of your blog or website where you can try out your changes first.
Here’s an easy way to set up a completely free local installation of your wordpress blog right on your Mac.
STEP 1. Download and Install MAMP
MAMP is a completely free program that allows you to set up your on local webserver.
When you go to their website, you’ll see this button:
Just click download now.
After your download is completed, just open the installer and install the program.
STEP 2. Install Your Local Server and Create a New Database
Once you run MAMP, a config page on your browser will automatically open up.
Just go to your phpAdmin section and put in the name of your database. Then click the create button.
STEP 3. Download WordPress
Go to the wordpress site and download wordpress.
STEP 4. Set Up WordPress in MAMP
When you download wordpress, it comes in a zip file.
You want to unzip that file and put it in your MAMP directory file under htdocs.
After you do that, you’ll need to open up your wordpress directory and make some small changes to one of the files.
First, rename the wp-config-sample.php file to wp-config.php.
Make the following changes with textedit:
Note: The name of your local database in most cases should be the same as the one I have in the following screenshot.
When you’re done, your file should look something like this:
Just save the file and you’re almost there.
STEP 5. Install WordPress
All you have left to do is install wordpress on your local host.
Just run your install.php file by going to the following url: http://localhost:8888/yoursite/wp-admin/install.php
Now, you’ll see the familiar wordpress install page come up and just follow the instructions for installing wordpress as you would normally.
Once you are done installing wordpress, you’ll be up and running with your local wordpress site. You can make any changes you would normally, install themes and plugins and go crazy wild with this install. It’s completely local to your computer and won’t affect anything on your live site.