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:
- Install a local server ( XAMPP).
- Configure PHP
- Launching Apache & Troubleshooting with Skype
- Create a new database via phpMyAdmin.
- Setup XAMPP Security
- Download WordPress from wordpress.org and install into the htdocs folder (typically C:/xampp/htdocs).
- Run the famous 5 minute install and follow the instructions: wp-admin/install.php.
- Done!
Paula Parisi says
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?
Thank you,
Paula
Travis Smith says
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.
Paula Parisi says
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.)
Thank you!
Paula
Travis Smith says
Yes, it is because of SQL injection, and no, they are not any different as the host on the server is generally configured to localhost anyways.
Hell-Preacher says
hey how to use filezilla to load plugins and themes on ur localhost…..
Travis Smith says
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.
Sherry says
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?
wpsmith says
No you don’t need a host and a domain name to install locally. This post tells you how to do what you are looking to do.
Sherry says
Hello I got camp installed. Changed pw on php but when I updated after putting pw I go to log in to it it’s not letting me? I’m 3/4 way thru any suggestions?