When developing, it is always good to have a local site. Many skip this and use only a staging site and the production site. However, having a local environment will make life easy with testing scripts quickly and easily. Change a file, save, and run. However, using a staging site, you have to FTP up and down, and with WordPress and Windows, this sometimes can get you into trouble if not done correctly.

So, we need to install Apache (the server software), PHP (the language that WordPress runs on), and MySQL (the database). To do this on an Apple machine, use the Make WordPress Tutorial for MAMP or see the older tutorial in the Codex: Installing MAMP. For Windows machines, there is XAMPP, which stands for Apache + MySQL + PHP + Perl.

Quick Summary

Here are the simplified steps on how to install WordPress on your local computer that we will walk through this week:

Customized Plugin

About Travis Smith

As a WordPress enthusiast, developer, and speaker, Travis writes about what he learns in WordPress trying to help other WordPress travelers, beginners and enthusiasts with tutorials, explanations, & demonstrations.

Comments

Hi Travis! Very helpful tutorial. Am curious as to why you’re recommending to change the database prefix from the default wp_. This is the second place I’ve seen that recommendation, but no explanation.

I plan to do multiple installs, and I’m wondering if it is fine to use any consistent db prefix (such as db_site1, db_site2, db_site3. Although rather than use such generic name/numbers I’d create more descriptive names, to help me identify the databases on the fly –without having to consult an org chart).

And shouldn’t there be something in the name that identifies them as WP databases? Just in case, later, I had to create straight MySQL databases for some other web use?

Yes, I recommend some complicated combination that only you understand that identifies the database. Many hosts like Hostgator in shared hosting will apply prefixes to your database for you (typically your username_yourdatabasename). Now for db_site1, db_site2, etc. that’s a great idea and if you are using WordPress 3 MS, then something like this is done for you on the table level.

I did find an answer to the above question, having to do with avoiding the malicious intrusion known as SQL injection. I have another question: Do you have to use the same username/password for the MySQL database on the host server as on the local server? (I am assuming this answer is “no,” but thought I’d double check with someone more expert.)

You don’t. You only need to use FileZilla to upload to WordPress that are hosted on servers as an FTP option. To use on your localhost, you can use Windows Explorer or whatever the Mac equivalent is. Now, WordPress is installed as localhost in wp-config.php:
[php]/** MySQL hostname */
define(‘DB_HOST’, ‘localhost’);[/php]

So if it is located on a site like domain.com, then you would need to use FileZilla. Download FileZilla. In Hostname, put ur domain.com, then insert your username and password and click QuickConnect. Your hosting provider should have some information on how to setup your FTP site.

Hello I’m just trying to insta wp to my comp(very new to it) not make it public I want to be able to mess up and only I can see it .do I need a host?a domain name? I got a host and a domain name but I’m lost can you help me?