Here are the simplified steps on how to install WordPress on your local computer:
- Install a local server ( XAMPP).
- Create a new database (phpmyadmin).
- Setup XAMPP Security
- Download WordPress from wordpress.org and extract the files to a new folder under the htdocs folder (typically C:xampphtdocs).
- Run the famous 5 minute install and follow the instructions: wp-admin/install.php.
Before You Get Started
WordPress needs PHP and mySQL to run. This tutorial installs via XAMPP, not WAMP or MAMP (Mac), so I will not be going into any details regarding WAMP or MAMP, but some of the things will apply to them as well.
1. Install XAMPP, a Local Server
In order to run any PHP/database application on a local computer, you need a local host (ie. Apache + MySQL). So go and download the most recent version of XAMPP or the version from this tutorial is XAMPP 1.7.4-VC6 (Sourceforge Old Versions, Windows Version). I selected to have Apache and mySQL installed as a service and not FileZilla since I already have that installed.
2. Create a New Database
After you’ve installed XAMPP, run it by opening a browser and going to localhost. It should take you to the start page, http://localhost/xampp/. Now click on phpMyAdmin. In the phpMyAdmin page, create a new database. Since this is local anything will do (eg. wordpress). However, you want a more complicated database name than this to protect yourself from SQL injection on the internet.
If when you install it, port 80 is busy. You want to navigate to your XAMPP directory (e.g., C:xamppapacheconf) and open the file httpd.conf in your text editor. On line 45, you’ll find:
#Listen 0.0.0.0:80 #Listen [::]:80 Listen 80
To change it to port 8080, simply make this change:
Listen 0.0.0.0:8080 #Listen [::]:80 #Listen 80
Then later, on line 176, you’ll see:
Change it to:
If you switch to port 8080, you’ll need to to always go to it via localhost:8080. Furthermore, WordPress will not allow you to enable multisite with a port number trailing localhost. So if you can have XAMPP take port 80, which may mean that Skype will need to be changed to another port. It will redirect you to http://localhost/xampp/ or http://localhost:8080/xampp/.
You’re host directory will be C:xampphtdocs based on httpd.conf. If you wish to change it, simply find it in httpd.conf on line 183 and make whatever changes you’d like. Now go to phpMyAdmin, and create a new database (eg. wordpress) by typing in your database name (e.g. wordpress) and pressing CREATE.
3. Setup XAMPP Security
Go back to localhost or localhost:8080 in your web browser. Click on security and it will open a new window/tab to http://localhost/security/index.php or http://localhost:8080/security/index.php. Then click on the link: http://localhost/security/xamppsecurity.php. This will allow you to change your mySQL password and .htaccess password. Since this is typically my sandbox for breaking things and developing code, I just enter a mySQL password. Click password changing and you will receive a message: The root password was successfully changed. Please restart MYSQL for loading these changes! Then close the window/tab.
4. Download WordPress
Go to wordpress.org and download the latest build of WordPress. Go to the htdocs folder (where you installed the XAMPP), extract the wordpress.zip to a new folder (eg. mywordpress).
5. Run the Famous WordPress 5-minute Installation (install.php)
With your browser, go to http://localhost/mywordpress/wp-admin/install.php or http://localhost:8080/mywordpress/wp-admin/install.php, click Create a Configuration File and click Let’s go! Fill out Database Name (eg., wordpress), User Name (needs to be root), Password, Database Host, and Table Prefix (it is always a best practice to change the default wp_ prefix to something else). Be sure the User Name is the same as your mySQL username, “root”. Then click Run the Install, and follow the instructions to install WordPress. Fill in the Site Title, Username, Password twice, and email. Then click Install, and then Login.