Top

Go Live, Before You Go Live! How To Use WordPress Locally

January 24, 2008

If you're new here, you may want to subscribe to our RSS feed. Thanks for visiting!

Getting your blog to look good is a long and involved process, especially if you are skinning it yourself. There is nothing more frustrating than having to FTP files back and forth to test a minor little change. Not only do you have to wait for FTP to do its (slow) thing, but you then have to reload all the files. Depending on your connection speed this can take some time and it is never instant. I’ve been known to go through the ftp-refresh-edit-ftp-refresh cycle every 20 to 30 seconds.

Another consideration in doing things this way, is that everything you do is completely visible to anybody who stumbles across your site while you are fiddling. If you have an established blog that you are updating, it is highly likely that many visitors will have to endure the many small errors you make until you fix them. In the past I’ve also been known to add some extra steps to my testing loop. I edit a file, FTP it to the server, refresh the page, if there is an error I will roll back immediately, which is another step with more FTPing. This takes time… HEAPS of time!

Recently I decided to do a complete re-design and re-code on a series of travel sites I own. This meant coding everything from scratch but I really couldn’t afford to disable anything I currently had running. I had finally had enough, I needed a better way. I knew what it was, but I had always been too lazy to bother with the potentially painful and time consuming task of setting up a local webserver. I considered adding a standalone box to my network simply for testing. I had also considered running a webserver on my development workstation. From experience I know its a P.I.T.A. to set up an Apache server with PHP and SQL, but the time had come as I really needed something!

You know those moments in life when you feel like fresh air has lifted a trouble from your soul? Well, I have to be honest and say, with very little effort, my troubles were lifted and I felt that fresh air!

how-to-use-wordpress-locally-using-WAMPServer The answer comes in a miracle little package, its called WAMP and you can download it for free from WampServer.com. Download it now, no really, just do it!

Here’s the instructions for setting up the WAMP server package. It includes an Apache server, PHP and SQL, but how hard is the whole deal to set up?

Instructions:

  1. Download WAMPServer package
  2. Run the install
  3. Vioala! Feel that fresh air, inhale life, you are done!

No joke, after running the install, you have a fully functioning webserver with PHP and SQL. Not only that, but management of your projects is easy as pie. Just point your browser towards localhost (just type ‘localhost’ in the address bar and press enter).

The default installation directory for your websites is “c:\wamp\www\”. Under this directory you will create a new folder for each new project. To manage your SQL databases, simple browse to localhost, and click on PHPmyadmin. You log in as root, with no password, and then you can go for your life with db installs.

If, for example, you want to install WordPress, or something like PHPBB, just unzip the package to an appropriate sub-directory, like “c:\wamp\www\blog” and then browse to localhost/blog. Follow the same install instructions as if you were installing these programs on a remote server, and vioala!

Once you have your files and databases all ready to go, you will see a fully functioning version of your website on your local PC. You don’t even need to be connected to the internet. Further, pages load instantly without a single seconds delay. If you want to make changes just use your windows explorer and head over to your blogs root directory.

For this example, browse to “c:\wamp\www\blog” and make any changes to the files there in notepad or whatever editor (anything works, Dreamweaver, Frontpage, anything.) You are really just editing a file as if it was on your desktop. No need to FTP anything, just save your changes and press F5 to refresh your browser. Vioala! (I’ve been using that word a lot in this article). No need to roll back, no need to worry about people being able to see your progress and/or errors, but most of all … no need to FTP!

You should be running a Firewall regardless, but the WAMP package seems to be well secured. While there is an option to put your site “online”, I would only recommend using WAMP to test files in “offline” mode. You can get a completely working version of your website, and then you can just dump it all onto your host. Transferring SQL databases is also easy providing your host has the PHPmyadmin program.

Just export your databases from your localhost SQL server and save the file on your local system, then load up your hosts PHPmyadmin program and do the opposite, using the import function.

It’s simply fantastic people, a huge time saver and it really improves your visitors experience since you’ll be doing all your dev-work on your WordPress blog locally.

Technorati Tags: ,,,,,,


Comments

4 Responses to “Go Live, Before You Go Live! How To Use WordPress Locally”

  1. craig.c on April 3rd, 2008 7:09 am

    how hard is it to get “your files and databases all ready to go”..?

    i have zero database/SQL experience, but have installed WAMP so i can work on some wordpress stuff sans internet.

    any noob tips would be very much appreciated.

  2. Vince on April 4th, 2008 10:18 pm

    its really easy criag, just copy the files from the web root directory, and export the sql database. Import the sql database on the other end, change the config file, and voila.

    Maybe that sounded complicated, but it really isn’t. You can outsource the task for maybe $50

  3. craig.c on April 10th, 2008 1:45 am

    i got that part sorted vince, thanks.

    so i spent some time building and editing offline. it’s great. thank you.

    but now i;’ve gone to login back in to localhost and continue editing. but i’m locked out - can’t “login” to the wordpress installation on localhost.

  4. Vince on April 11th, 2008 4:45 am

    Hey Craig,

    Your local installation of wordpress works just like any other wordpress install on a web based server. The only difference is that you can’t recover your admin password by email.

    In this case I would recommend you export the database from your webserver install, and import it into your local database. This way your password for the admin login on the web server will be the same as your password on your local server.

    Good luck. It all gets lots easier with some practice.

Got something to say?





Resources

  • Blog Themes
  • Blogging Tools
  • FireFox & Addons
  • Image Tools
  • Plugins
  • Useful Reference Blogs & Websites
  • Utilities
  • Widgets

Community

Add to Technorati Favorites Subscribe with Bloglines Google PageRank Checker - Page Rank Calculator Blogging Blogs - Blog Catalog Blog Directory