Sunday, February 25, 2007

Converted Blag to GBlag

I just caved and converted my Blogger blog to the new Google format/layout/whatever, and as a result, was forced removed the 'valid xhtml 1.0' banner since the website isn't even REMOTELY valid anymore. Thanks a lot, Google.

After some testing with the W3C Validator and different doctype declarations, I found that the ~800 validation errors are nearly ALL caused by Blogger not escaping its URLs properly (e.g. page.g?arg1=blah&arg2=blah), as well as using Javascript to write HTML tags to each page. Until Google fixes these two problems, it is impossible to get your blog to validate since no doctype declaration allows for unescaped URLs. <:-[

Friday, February 09, 2007

Papa's got a brand new Wiiiii

Oh man, I'm gonna be so popular.

I order a Wii, bitches

Note to other people in NL: Wii's are not yet sold out in Germany! :D

Sunday, February 04, 2007

Short & Sweet

Short post:

One: Jack Thompson may not be a lawyer for very long anymore. Long blog post on GamePolitics. Jack faces five counts of professional misconduct, three of which are related to his ongoing campaign against violent video games. Thompson faces the possibility of disciplinary action up to and including disbarment.

I'm surprised it took so long before court did something about this ass-clown. It was fun laughing at him while it lasted, though.

Two: Best Penny-Arcade comic in a while! Federal Bureau of Taking All Your Shit


Saturday, February 03, 2007

Complete Idiot's Guide to WAMP

So, you got it in your head for some reason that you want to run a webserver on your Windows machine? With PHP, MySQL and all that fancy jazz? Well so did I, so I wrote this little guide after mucking about for two days, following various guides that didn't work, were incomplete, incorrect or outdated.

If you're like me, you have been using one of the preconfigured packages, like EasyPHP or XAMPP. The problem is, after using that for about a year, new versions of PHP, Apache and MySQL popped up left and right. And new versions of those handy packages don't come out overnight. Lucky for you, it's possible to download the components separately, mash it all together and have it come out a working WAMP server!

The following howto is a guide helping you on your way with setting up Apache 2.2, PHP 5 and MySQL 5.0 on a Windows XP machine. Windows 2000 or newer works as well, Windows 98/ME will NOT (stick with Apache 1.3 for those). I tried to make it as detailed as possible without including screenshots of each step in the install process and adding 'click Next on this screen'.

Get the software

First, you'll need to download everything so you can install everything in one big swoop.
  • Apache 2.2 - the actual webserver. Select a mirror, then click the link for Win32 Binary (MSI Installer).
  • PHP 5 - the scripting language that will be the middle man between Apache and the MySQL database. Click the link for PHP 5.2.0 zip package (the installer does not have all extensions).
  • MySQL 5 - the database software. Click on 'MySQL Community Server', then click 'Select a mirror' for Windows (x86) ZIP/Setup.EXE. Skip past the form and click one of the HTTP links for a mirror close to your location.
  • phpMyAdmin - a PHP 'program' that allows you to configure MySQL. You could use the commandline programs that come with MySQL, but this is way easier. Click the link for

IMPORTANT: If you plan on doing ANY kindof IP-based filtering in Apache, or use PHP for any kind of IP-based verification (with $_SERVER['REMOTE_ADDR']), do NOT get Apache v2.2.4!! There is a bug in this Apache version together with PHP 5 that makes it return instead of the correct IP. This bug also affects any kind of IP address filtering with allow/deny in httpd.conf/.htaccess. Get Apache v2.2.3 instead, it works fine and does not have this bug.

Install everything

This is dead easy. Follow my lead.

Base directory: to keep things together, you might want to create a central folder where you're going to put everything. Preferably without spaces in the name. I chose to make C:\WAMP. If you prefer something else, substitute your path wherever it says C:\WAMP in the below steps.

Apache: Open the MSI installer file and click through the screens. Accept all the default settings until you reach the Destination Folder, where you will change it to C:\WAMP\Apache. If all goes well, you should be seeing a little Apache feather with a green icon in the system tray:

The Apache Monitor in the system tray
This is the Apache Service Monitor, which keeps an eye on the Apache process itself. It's handy for controlling Apache, but if you like, you can shut down the monitor without closing Apache itself.
Now go to http://localhost. If you get the message below, you did everything right.

It works!

PHP: Open the PHP install zip and extract everything to C:\WAMP\PHP. Make sure all the subdirectories are created.

PHP directory

MySQL: Open the MySQL install zip and double-click the Setup.exe file inside to start it. Pick the Custom install, then change the install path to C:\WAMP\MySQL. Let it install MySQL, skip the ' Sign-Up' and continue to configuring the MySQL server.
At the screen for 'default character set', select your best option.
At the screen for 'set security options', enter a root password.
Everywhere else, accept the default setting. Click Execute at the end to configure the MySQL server and you're done!

phpMyAdmin: Open the phpMyAdmin install zip and extract everything to C:\WAMP\Apache\htdocs. Make sure all the subdirectories are created. Open the install folder and rename the long-ass phpMyAdmin-2.x.x-english directory to pma.

phpMyAdmin directory

You now have four separate pieces of software installed! Next up: tieing everything together into a neat WAMP package.


If you did everything correctly, Apache is already up and running. Now all we need to do is:
  1. Make Apache understand PHP
  2. Make PHP understand MySQL
  3. Make Apache understand MSQL
  4. Configure phpMyAdmin
Sounds easy? Well it's not really all that easy, but that's what this guide is for.

Step 1:

Find the file C:\WAMP\Apache\conf\httpd.conf and open it in Notepad (or whatever you prefer).

Find the section with all the LoadModule lines, and add this one to the bottom:
LoadModule php5_module "c:/WAMP/php/php5apache2_2.dll" (note: use forward slashes)
This makes Apache load the PHP module.

Next, find the line that starts with DirectoryIndex. Change it so it reads:
DirectoryIndex index.php index.html
This makes Apache understand index.php (default) files.

Now find the section with the AddType lines. Add these two:
AddType application/x-httpd-php .php .phtml .inc .php3
AddType application/x-httpd-php-source .phps

This makes Apache know what to do with the .php filetype.

Save the file and close it.
Next, go back to your C:\WAMP\PHP directory and do this:
  • Copy the php5ts.dll file to C:\WAMP\Apache\bin.
  • Copy the php.ini-recommended file to C:\WAMP\Apache.
  • Rename the file to php.ini.

The copied PHP.ini file

Open the php.ini file in Notepad, and change this line:
short_open_tag = Off
short_open_tag = On
This allows for writing php using the short <? .. ?> tags.

While you're at it, change this line:
;session.save_path = "/tmp"
session.save_path = "c:\windows\temp" (or wherever your temp folder is)
This lets PHP know where to store sessions.

Double-click the Apache icon in the system tray and click Restart to make Apache read the new configuration. Apache is now configured to understand PHP!

To test this, create C:\WAMP\Apache\htdocs\index.php. Then open it in Notepad and type <?phpinfo()?>. Save the file and close it.
Go back to http://localhost and refresh. If you see a boatload of PHP information, you did it!

phpinfo() demo

Step 2:

Now the next part is adding MySQL support to PHP.

Find the file C:\WAMP\Apache\php.ini and open it. Find the line:
extension_dir = "./"
and change it to:
extension_dir = "C:\WAMP\PHP\ext"
This lets Apache know where to find the MySQL extension for PHP.

Find the line:
and change it to:
This loads the multi-byte string extension so phpMyAdmin can handle strings correctly.

Find the line:
and change it to:

This lets Apache load the two MySQL extensions from the PHP extension directory.

Save the file and close it. PHP is now configured to use MySQL!

Step 3:

All you need to do now is make Apache load MySQL. Easy enough!
Find the file:
Copy it to:
This makes Apache load the MySQL library.

Go back to the Apache Service monitor again (double-click the icon in the system tray) and restart Apache once more to load all the new settings and libraries.

Step 4:

Now go to http://localhost/pma to load phpMyAdmin.
Since you haven't configured it yet, it can't access the MySQL database.

phpMyAdmin error screen

To do this:
  • Go to the C:\WAMP\Apache\htdocs\pma directory.
  • Rename the file to
  • Open the file in Notepad and find this line:
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
  • Change it to:
    $cfg['Servers'][$i]['auth_type'] = 'config';
  • Below it, add this line:
    $cfg['Servers'][$i]['user'] = 'root';
  • Below that, add this line:
    $cfg['Servers'][$i]['password'] = 'your MySQL root password';
  • Find the line with controluser and delete the part pmauser between the quotes.
  • Find the line with controlpass and delete the part pmapass between the quotes.
  • Save the file and close it.
If you reload http://localhost/pma now, it should give you the main screen for phpMyAdmin.

phpMyAdmin main screen

You're done! Everything is setup now. Your WAMP server is finished!


  • If you can't get to http://localhost, Apache isn't running. Go to Start > Run > services.msc, find Apache2 in the list and start it. If it's not in the list, reinstall Apache.
  • If Apache doesn't start, there is an error in the httpd.conf configuration file.
  • If no one can get to your webserver, make sure your firewall and/or router allows it.
  • Make sure you did everything correctly!