I hit a few problems along the way though, mostly down to inexperience with the software and not RTFMing. For reference I was installing the latest version of MediaWiki (1.5.6) on a Windows 2000 Server box (IIS 4 installed) with PHP 4.4.2 and MySQL 4.1.18. I had three main problems:
- MySQL / PHP Old Password problems
- Windows Access Rights / Permissions
- Bugs in MediaWiki due to PHP on Windows working differently
I’ve hit the MySQL / PHP password problem quite a few times due to college stuff I’ve been doing but never got round to documenting it properly (I have now!). The usual error message you get back from PHP is Client does not support authentication protocol. Basically the problem is that MySQL now uses a new method for password encryption and PHP isn’t compatible with it. I find it a real pain in the backside that they’ve managed to engineer this kind of cock up. You end with passwords being stored that can’t be read properly.
To stop it happening you need to add old_passwords to the [mysqld] section of my.ini. Then restart the MySQL service for it to take affect. If you’re unfortunate enough to end up with broken passwords, the fix is to login to your MySQL database, work out which ones are using the new method and manually fix them. Like this:
- Get list of users affected: SELECT Host, User, Password FROM mysql.user WHERE LENGTH(Password) > 16;
- Fix their passwords (one at a time): SET PASSWORD FOR ‘some_user’@’some_host’ = OLD_PASSWORD(‘newpwd’);
The access rights were totally down to me not being awake. I’d remembered to set up script access in IIS, no problem, but I forget everytime to add the correct IUSR_MACHINENAME permissions. You have to add the local machines internet user to have different permissions to various folders (mostly just read access to the entire site, but write access to the images subfolder if you want to upload) and I must have been asleep, because to start with I was assigning the domain controllers IUSR and was wondering why it wasn’t working (by default Windows gives the user list of those on the domain, I should have selected the local machine). Once I got my brain into gear, after about 5 cups of Rocket Fuel, I got round it.
At this point I was still getting errors on various pages with a PHP blurting out something along the lines of Undefined index REQUEST_URI. Turns out that in PHP for Windows you need to use SCRIPT_NAME instead of REQUEST_URI… obviously. So a bit of search and replace through the MediaWiki source code sorted that out (there were about 5 files).
After which, all was fine and dandy! Now I just need to get my head around how the system works!
Installing MediaWiki on Windows Server 2003 SP1 – covers everything I’ve said and more!
Client does not support authentication protocol – this is MySQL 5 help but it still applies to the version I was using.