If your are seeing nothing but just garbage/binary codes on every single page of your gallery2 installation, it is because the data type for cache data is stored in an inappropriate format. To fix this, change the data type of g_value column in CacheMap table to binary format (see below for a screenshot from phpMyAdmin). It is by default set to LongText data type which works for some web servers but not for others.
[tags]gallery2, data types, binary[/tags]