On Making a Web Site – Tools

Wordpress Install

First thing is to make sure your test platform defaults to your index.php (no more .htm or .html files, kiddies!). Go to your equivalent of C:\Program Files\Apache Software Foundation\Apache2.2\conf and open the httpd.conf. Change your DocumentRoot to match the directory you unpacked Wordpress. Also there’s another Directory two sections down you need to change to the same folder. Then find the DirectoryIndex and change it to index.php like the following (use CTRL+F to help you search for it):

1
2
3
4
5
6
7
8
9
DocumentRoot "C:\Web Pages\IanSwenson.com"
[...]
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "C:\Web Pages\IanSwenson.com">
[...]
<IfModule dir_module>
    DirectoryIndex index.php
</IfModule>

Next, go to your equivalent of C:\Program Files\PHP and open the php.ini. Find the php_mysql.dll extension and uncomment it by removing the semi-colon. It should look like the following (remember, CTRL+F is your finding friend):

1
2
3
4
5
[...]
;extension=php_mssql.dll
extension=php_mysql.dll
;extension=php_mysqli.dll
[...]

Sometimes you also need to copy libmysql.dll from your PHP directory to C:\Windows\System32 . I don’t know why this is necessary, but it fixed my setup. Here’s a video that could help if you’re having trouble with any of the above steps:


http://www.ianswenson.com/v/making/pt2_apachephp.flv

Third, go to Control Panel -> System -> Advanced -> Environment Variables and edit or newly create the Path variable. Enter your directory for your PHP; it should be C:\Program Files\PHP\ .

Fourth, open HeidiSQL and create a new database with the charset utf8 and title it something to the effect of username_wp or something else that makes sense to you. You also might want to open HeidiSQL’s User Manager to create a new username and password to mirror those you use on your web host. That way you won’t have to change configurations too much.

Once you have your table set up and your username created, you’re ready to edit your Wordpress config file. Go to the directory where you unpacked the Wordpress zip file and open up wp-config.php. Change the following so it matches your username and password. Also, follow this link to randomly generate a secret key for Wordpress

1
2
3
4
5
6
7
8
9
// ** MySQL settings ** //
define('DB_NAME', 'username_wp');    // The name of the database
define('DB_USER', 'username');     // Your MySQL username
define('DB_PASSWORD', 'password'); // ...and password
define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
[...]
define('SECRET_KEY', 'put your unique phrase here'); // Change this to a unique phrase.

Save the file and you should be all set to run the installation. Start the MySQL service and the Apache Server. Open up your favorite browser — which is Firefox of course — and enter http://localhost into the address bar. You should get the Wordpress install prompts and just follow the instructions. If you get some sort of “cannot find server” error, then there’s some problem with the Apache setup. If Wordpress complains it can’t find the database, then there’s some problem with the MySQL or PHP setup. Here’s another video to help you with that:


http://www.ianswenson.com/v/making/pt2_wordpressinstall.flv

But if everything goes correctly, you should be able to view your own Wordpress local server and your first “Hello World” post!

In order to get Wordpress working on your web site, you’ll need to upload all the unpacked Wordpress files to your server via FTP. The only difference is the wp-config.php file. It might need different settings depending on your web host. You’ll also need to go to your host and set up a database using their MySQL client. It shouldn’t be too tough if you’ve mastered everything here so far. If it is tough, ask for your host’s help. :)


Leave a Reply

You must be logged in to post a comment.