« Previous post
Fools and smart people

Next post »
[WP Install] Step 9. Installing and testing the first Blog (the Famous 5-Minute Install, at Long Last!)

[WP Install] Step 8. Preparing to install WordPress: Setting up the configuration file for the first Blog

Thursday, 26 April 2007

Once you have set up and organised local and remote directories, you can now create and store the WordPress configuration file for the first test blog, which, in the example I am using for this tutorial, is called martad7 and will be installed at

http://www.soapboxcorner.info/martad7/

This is how you set up the configuration file:

A.    Locate your local copy of the wp-config-sample.php file, which is inside your local wordpress directory.

B.    Duplicate the wp-config-sample.php file.

C.    Rename the wp-config-sample copy.php file to wp-config.php.

D.    Move the wp-config.php file to your local /Documents/WWW/WP_Blogs/martad7/ directory.

E.    Open this wp-config.php file in your favourite text editor - I use Bare Bones Software’s BBEdit. This file looks like a simple text file, and its contents are included below:

[1]	< ?php
[2]	// ** MySQL settings ** //
[3]	define('DB_NAME', 'wordpress');    // The name of the database
[4]	define('DB_USER', 'username');     // Your MySQL username
[5]	define('DB_PASSWORD', 'password'); // ...and password
[6]	define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
[7]
[8]		// You can have multiple installations in one database if you give each a unique prefix
[9]		$table_prefix  = 'wp_';   // Only numbers, letters, and underscores please!
[10]
[11]	// Change this to localize WordPress.  A corresponding MO file for the
[12]	// chosen language must be installed to wp-includes/languages.
[13]	// For example, install de.mo to wp-includes/languages and set WPLANG to 'de'
[14]	// to enable German language support.
[15]	define ('WPLANG', '');
[16]
[17]	/* That's all, stop editing! Happy blogging. */
[18]
[19]	define('ABSPATH', dirname(__FILE__).'/');
[20]	require_once(ABSPATH.'wp-settings.php');
[21]	?>

Note:

>     The comment at line 6 (99% chance you won’t need to change this value) clearly refers to different situations. When installing WordPress on a remote Web server, in fact you will need to change this value to reflect the name of the database server assigned by your host.

 

F.    Replace the default values at lines 3, 4, 5 and 6 ('wordpress', 'username', 'password', 'localhost') with the values you have noted down in your Web book when you set up the database for your WordPress blogs (Step 5: Preparing to install WordPress: Setting up the Database).

G.    Because you will be running more than one blog using the single database you set up in Step 5, you must also change the value for $table_prefix (line 9) to the name of the blog you are preparing to install —in this case, martad7_. To avoid possible future problems and confusion, you might as well change the text of the comment at line [9], and describe what and who this Blog is for. For the martad7 blog, you can use something like "First test blog set up at [URI] on [date].

H.    If you wish to localise WordPress for this blog, you will also add the correct language name between the empty '' at line 15.

L.    That’s all for the editing required in the wp-config.php file. Save your local copy, and use your favourite FTP tool to copy this file over to your Web server, in the correct location… which in this fictitious installation is the server path to http://www.soapboxcorner.info/martad7/.

Leave a Reply