More notes to myself, on the experience of installing WordPress on Windows Server 2003 Standard, IIS, MySQL, and PHP. Boring boring boring. But, these notes just might save my ass next time I have to do this. Keep in mind I don’t really know anything about Windows Server or IIS, so please take with a grain of salt ;-)
Installing PHP & MySQL
These instructions from Ringmaster on the WordPress Codex were a very helpful starting point as far as what packages to download, and the order to install them in. Basically:
- Download latest 4.x version of PHP Installer Binary for Windows. Don’t download 5.x, since WordPress 1.5 isn’t tested with it. Using the Installer also configures IIS for you automatically for PHP. Yay! The first time I ran it, I got some script errors related to certain script files not being associated with a script interpreter…something about CSCRIPT and WSCRIPT. I clicked “Accept” on an offer to associate scripts with a particular interpreter, ran the installer again, and it seemed to work properly. Thank goodness.
Download the latest MySQL Installer Binary for Windows. I grabbed 126.96.36.199, which apparently breaks WordPress 1.5 (more specifically, PHP’s database connection code), but you can change a setting and it will work. More on that later. Incidentally, I downloaded the “Essentials” installer package, which is the leanest and meanest MySQL installation you can download. It doesn’t come with a GUI-based database adminstration tool, though, which sort of bites…if that’s important to you, download the BIG one. The Installer package does nice things like set up the service to automatically run, so you don’t have to worry about it. One less headache! When you run the Installer, you’ll get prompted for a password for the
rootuser. Pick something you won’t forget…this is the main database password that you’ll need to add users later. Otherwise, you’ll be locked out of your database…and wouldn’t that be embarassing. You also are prompted for a lot of decisions about how to configure the server. I just accepted the defaults, which are fine for a light webserver. The one thing I changed was the way text was stored; I choose Unicode (UTF-8) just because it might be nice to support Asian characters in the blog. I don’t know if this was necessary, but I chose it anyway. Nyah!
p>The rest of the document was not so helpful about IIS configuration…it’s assumed you know how to do it already. I don’t, so the following steps detail what I found out.
Copying WordPress Files
I grabbed the WordPress 1.5.2 .ZIP file, unpacked it, and then copied it to
C:InetPub, which is sort of the equivalent to
htdocs on Apache. I copied my
wordpress directory there:
Next, you gotta set permissions on
wordpress directory needs to have a user called Internet Guest Account added to it. Right-click the folder in the Windows Explorer, choose the SECURITY tab, and then click ADD. Type in the name of the user—on mine, it looks like
HOSTNAMEIUSR_HOSTNAME, where HOSTNAME is the name of your computer.
The specific permissions I added: READ&EXECUTE, LIST FOLDER CONTENTS, READ, and WRITE. WRITE appears to be necessary so WordPress can create the default Theme file. I’m not sure if LIST FOLDER CONTENTS is strictly necessary.
Next, I used IIS Manager to add a new “Virtual Directory” for the “Default Web Site”. This allows you to add “directory names” to your main website root. In a new IIS installation, the website you start off with is actually called Default Web Site; by right-clicking the name in the IIS Manager, you can choose New… then Virtual Directory. In the wizard dialog that follows, give it a name (this is marked “Virtual Directory Alias”) and a corresponding location (“Web Site Content Directory”) on disk, and choose run scripts to finish up.
So what does that mean? You have just added a subdirectory to your website URL that actually points somewhere else; it’s like a symbolic link in unix, or a shortcut in Windows. Say your server’s domain name is
server.myhost.com; the default location for web files (as defined by Default Web Site) is
C:InetPubwwwroot. Now, I could just have stuffed the
wordpress directory into there, but I decided to put it at
So yeah. while I could have put the WordPress files in a subdirectory in
C:InetPubwwwroot, this gives me a tiny bit of extra flexibility (see Footnote 1). Frankly, I’m not sure it was necessary, but I did it.
Now, you need to right-click the resulting icon (the
wordpress object you just wizarded-up) and choose PROPERTIES. Click on the DOCUMENTS tab and add
index.php to the list of “default content pages”.
While you’re here, check out the VIRTUAL DIRECTORY tab: you’ll see where your wizard-entered values ended up. In typical computer bullshit fashion, they use different names (gah):
- “Virtual Directory Alias” is called “Application Name”
- “Website Content Directory” is called “Local Path”
- The script permissions are under “Execute Permissions”
I think that should do it…if you browse to
http://yoursite.com/wordpress, you should see a nice error message about not being able to connect to the database. That means the PHP is working! But we have to set up the database and database connection next.
Troubleshooting: If you get an error that you’re not allowed to access the resource, or if you see an authentication dialog, check permissions.
Troubleshooting: It is also possible that your Virtual Directory is set to not allow anonymous connections to your website…you can check that by right-clicking the Virtual Directory (
Default Web Site), choosing PROPERTIES, then clicking the DIRECTORY SECURITY tab and clicking EDIT under Authentication and Access Control.
Troubleshooting: If you see “Error 403 Forbidden Execute Access Is Denied”, you need to set the “Execute Permissions” on the
wordpress Virtual Directory object…it’s under the VIRTUAL DIRECTORY tab. Change it from “None” to “Scripts Only”, and that should do it.
Creating the Database
At this point, both PHP and MySQL are installed. Before WordPress can start its famous 5-minute install, you need to spend several minutes creating a database and a user for it to use.
Now, I had downloaded the “Essentials” version of MySQL 188.8.131.52, so it didn’t come with a nice graphical GUI. It comes with the MySQL Command Line Client, which you could use to do something like the following:
CREATE DATABASE 'wordpress_database'; GRANT ALL ON 'wordpress_database' TO 'user'@'localhost'; SET PASSWORD FOR 'user'@'localhost' = OLD_PASSWORD('user_password');
…which theoretically would work; note the
OLD_PASSWORD call: this is a workaround for MySQL 4.1+ changing the way password authentication works, which breaks the version of PHP I was using.
I was actually a lot lazier and downloaded MySQL Administrator instead, which is a GUI interface. Ordinarily I like using the command line, but not for SQL. Typing SQL statements gives me a huge headache, plus the syntax never seems to exactly match the documentation. Like the use of ' characters… sometimes you need them, sometimes you seem to actually have to use " or not at all, or the function names were changed in the particular build you have…Bah!
Anyway, to set the OLD_PASSWORD parameter in MySQL Administrator (v1.0.21 for me), go to STARTUP VARIABLES, select USE OLD PASSWORDS, then stop/restart the server using SERVICE CONTROL. This worked, and MySQL Administrator only crashed on me once! Whee! That’s quite an improvement over earlier versions :-)
If you had set the password before setting the USE OLD PASSWORDS value and restarting MySQL , you will need to set the password again. After that, you’re finally ready for the WordPress 5-minute install.
For completeness, Footnote 2 (on the second page) covers the basics of what I did to use MySQL Adminstrator.
WordPress 5-Minute Install
It’s the one you know and love: edit
wp-config.php, then navigate to the Install URL. For the database name, database user, and database password, use the values you used in the previous step. The database host is
localhost. MySQL Administrator is useful for verifying and testing the values before you peck ’em into the config file.
Troubleshooting: if you are getting an error about not being able to establish the database connection, and you’re absolutely sure you have the correct database name, etc…it might be that OLD_PASSWORD thingy. That’s what happened to me. Grr.
Troubleshooting: If you get a permission denied error writing a file in Step 2, it might be related to not having WRITE permissions set for the IUSR_HOSTNAME user on
C:InetPubWordPress. I got that error, and set write permissions, and it seemed to work.
It seems to be working. I haven’t tried any plugins yet, or any of the mail-based features, so we’ll see…