How to Set Up a Blog Site With WordPress on a Localhost

I do not like the “all-in-one” XAMPP package which offers Apache, MySQL, PHP and other tools in the one application.

It is quite hard to customize or optimize each part individually or fix any issue that may arise.

It is also difficult to discover the root cause an individual part may have when they are all bundled in one package.

consequently, I came up with this tutorial to show you how to install Apache, MySQL and PHP separately and customize each of them to best suit your needs.

I can assure you that there will be no help obtainable on the internet showing you how to install each of them separately as good as this tutorial! Other tutorials always leave out a little piece of configuration here and there resulting in a failed installation.

I installed each part on my local PC and proven each step in this article.

These steps will work on Windows operating system.

I’ll write another tutorial on Ubuntu Linux in the near future if there’s interest from you my dear readers.

If you have any question about these steps or experience difficulty when setting it up, feel free to ask. You will find my contact details via the link to my website in the resource box at the end of this article.

1. MySQL setup:

Download the latest version of MySQL Community Server at

Version 5.1.42 is the current version of MySQL at the time of this writing.

My downloaded file is mysql-5.1.42-win32.msi

Run the MSI file and use the following settings:

* Typical Setup kind

* Check “Configure the MySQL Server now” and “Register the MySQL Server now”

* Check “Detailed Configuration”

* Check “Developer Machine”

* Check “Multifunctional Database”

* Accept default setting for “InnoDB Tablespace Settings”

* Check “Decision sustain (DSS)/OLAP”

* Check “permit TCP/IP Networking” and “permit Strict Mode”. Leave the port number at 3306.

* Check “Standard Character Set”

* Check “Install As Windows Service” and “set afloat the MySQL Server automatically”.

* Check “Include Bin Directory in Windows PATH”. This option will let you run MySQL from the command line. It’s very helpful.

* go into a new root password and do NOT check “permit root access from far away machines” and “Create An Anonymous Account” since these two options will create security loophole.

* Click “Execute” and it will install MySQL on your local machine.

Start MySQL and create a new database for your WordPress installation. You should provide an appropriate name for your database. In this tutorial, I name the database as “WordPress” and the admin user as “wpadmin”. Change it to at all event you like.

Open your terminal (MS DOS or cygwin) and execute the following commands:

$ mysql -u root -p

go into password: ********

mysql> create database WordPress;

Query OK, 1 row affected (0.03 sec)

mysql> grant all on WordPress.* to wpadmin @localhost identified by ‘changeme’;

Query OK, 0 rows affected (0.03 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.02 sec)

mysql> exit


2. Apache setup:

Download Apache 2.2 at

My downloaded file is httpd-2.2.15-win32-x86-no_ssl.msi

Run the MSI file and use the following settings:

* Network Domain: localhost

* Server Name: localhost

* Administrator’s Email Address: youremail

* Make sure “for All Users” is checked.

* Typical Setup kind

* Hit “Install” and it will setup Apache on your local machine.

After the installation completes, go to Control Panel -> Administrative Tools -> sets, look for the “Apache2.2” service and double-click it.

From here you can stop the service and change the startup kind to “Manual”

Configure Apache:

Open and modify the httpd.conf at C:Program FilesApache Software FoundationApache2.2conf as below:

Uncomment the following line:

LoadModule rewrite_module modules/


LoadModule php5_module “C:/php/php5apache2_2.dll”

Search for

<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">


AllowOverride None


AllowOverride All

Add index.php to DirectoryIndex as below:

DirectoryIndex index.php index.html


<IfModule mime_module> and add:

AddType application/x-httpd-php.php.phtml

Add this line to the end of httpd.conf

PHPIniDir “C:/php”

Restart Apache to make the updated configuration effective.

3. PHP setup:

Download PHP 5.2.13 at

My downloaded file is

Unzip the downloaded bundle to C:php

Copy C:phplibmysql.dll to C:WINDOWSsystem32

Copy C:phpphp.ini-recommended and rename it as php.ini

Open and modify the newly copied C:phpphp.ini


extension_dir = “ext”

extension=php_gd2.dll (this is used for CAPTCHA)




date.timezone = “Australia/Melbourne”

4. WordPress setup:

Download the latest version of WordPress at

At the time of this writing, it is version 3.0.1

Download and unzip to C:Program FilesApache Software FoundationApache2.2htdocs

Go to C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/WordPress

Rename wp-config-sample.php to wp-config.php

Update wp-config.php at C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/WordPress with the following settings:

define(‘DB_NAME’, ‘WordPress’);

define(‘DB_USER’, ‘wpadmin’);

define(‘DB_PASSWORD’, ‘changeme’);

define(‘DB_HOST’, ‘localhost’);

Click the following link to generate secret keys and replace the following values with the generated keys from that link.

define(‘AUTH_KEY’, ‘put your rare phrase here’);

define(‘SECURE_AUTH_KEY’, ‘put your rare phrase here’);

define(‘LOGGED_IN_KEY’, ‘put your rare phrase here’);

define(‘NONCE_KEY’, ‘put your rare phrase here’);

Make sure the Apache server is nevertheless running. If not, start it up.

Open your favourite browser at:


Follow the instructions displayed on the screen to complete the installation of WordPress.

Leave a Reply