I have been meaning to write a series of articles relating to WordPress for quite some time now, so to get you started at the most basic level I’m going to show you how to install WordPress locally so that you can tweak away and fiddle around to your hearts content on a site that’s dynamic yet running locally so that no one but yourself can see.
Let’s make a database
Now that you have MAMP or WAMP installed we need to set up a database, this is so that we can post, write and store data locally. Fire up MAMP or WAMP and select phpMyAdmin from the menu. All we need to do here is give our database a name. In this example I will call my database TestSite.
The next step is to grab the latest release of WordPress and download it to your desk top. Unzip it and rename the folder TestSite and place this folder inside the ht docs folder of the MAMP/WAMP folder (sometimes called www in WAMP).
Inside the TestSite folder there is a file called wp-config-sample.php. Open up this file in a text editor so we can configure our database details (db_name, user, password, host). Look at the top of this file and edit the details below:
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
/** MySQL database username */
/** MySQL database password */
/** MySQL hostname */
Our database we set up earlier was called TestSite so we enter this in DB_NAME
Our user name and password will be just root (Don’t set it to this on a live site!)
Our MySQL hostname will be just localhost.
That’s it done! All we need to do now is save this file as wp-config.php and save it in the same folder as sample-wp-config.php.
When we do an automatic version upgrade of wordpress, all the core files get overwritten (not your themes) all except wp-config.php as the new version just places sample-wp-config.php in there instead without overwriting wp-config.php.
Run and Install WordPress
Open a browser and put in your location bar
- http://localhost:8888/TestSite/wp-admin/install.php (MAMP) or
- http://localhost/TestSite/wp-admin/install.php (WAMP)
You will be taken to the install page. Follow the instructions and you are up and running with WordPress locally on your machine.