OSM and freethepostcode are no longer behaving strangely.
The gory details:
php4 and ruby were linking to different versions of libmysqlclient.
Apache2 was trying to load two versions of the same library and getting
all confused and breaking on php and ruby scripts run through
mod-ruby and mod-php4. This wasn't the easiest thing to find in the
world and a bug has been passed upstream to Debian: