Installing Wordpress Locally

To develop a template, solve problems or test something without taking risks with the weblog, a local installation of Wordpress can be helpful. This is done in 5 steps.

1) Install Wamp

This tutorial is designed to Wamp but it could work perfectly with any other local server including PHP and MySQL.

2) Install Wordpress

Unpack the Wordpress archive in /wamp/www/wordpress
It is also possible to use virtualhost to install multiple sites, but that is another matter.

3) Create a database

For this, we enter in phpMyAdmin from the Wamp menu in the taskbar, and in phpMyAdmin, we click on the "Create a database" link after entering the name chosen for the base in the input field below the link.

4) Fill wp-config.php

?php
// ** MySQL settings ** //
define('DB_NAME', 'wordpress');
define('DB_USER', 'root');
define('DB_PASSWORD', ''); 
define('DB_HOST', 'localhost');  
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

// You can have multiple installations in one database if you give each a unique prefix
$table_prefix  = 'wp_';   // Only numbers, letters, and underscores please!

// Change this to localize WordPress.  A corresponding MO file for the
// chosen language must be installed to wp-content/languages.
// For example, install de.mo to wp-content/languages and set WPLANG to 'de'
// to enable German language support.
define ('WPLANG', 'fr_FR');

/* That's all, stop editing! Happy blogging. */

define('ABSPATH', dirname(__FILE__).'/');
require_once(ABSPATH.'wp-settings.php');
?>

This file is at the root of wordpress. Rename wp-config-example.php in wp-config.php.

The name of the database (DB_NAME): it is that you created with phpMyAdmin. "wordpress" is an example.
The username (DB_USER): root
The password: none.
The server (DB_HOST): localhost.
The charset: you choose, the default is utf8.
The language you choose, nothing for English otherwise enter the code, for example fr-FR and install the corresponding mo file into /wp-includes/languages/.

5) Start

Click on localhost in the Wamp menu. Click on wordpress. An error message appears, you must specify the full path:

http://localhost/wordpress/wp-admin/install.php

This can be done directly by typing this URL in the navigation bar of the browser.

Then click on install, and it is finished.

Importing the content of a blog

If you already have a blog online, you can retrieve its content with the export command on the site, and import it locally. This can be particularly useful to verify the compatibility of a new version of Wordpress with the database before installing it.

In this case, you have to increase the memory size allowed to PHP in the php.ini file in the php subdirectory of Wamp:

memory_limit = 64M ; Maximum amount of memory a script may consume (8MB)

(c) 2008 Scriptol.com