Author image
Senior Mind

Drupal cache serves blank page

We inherited another site today, with an interesting problem (actually it has many problems but that's another story). When the Drupal cache is enabled totally blank pages are often displayed. A quick google search fails to bring back much info, so it looks like were going to actually have to work for dinner today :)

Now a blank page is usually a sure sign of a PHP error, the sort of thing that on a dev environment you would resolve in seconds as the message would pop up on screen. No such luck on an inherited production environment. So first step is to hit SSH onto the prod server, all looks good so far - now where are those error log files?

One of the joys of inheriting an existing site is you get to experience a wide range of creative server configurations. In fact we have yet to come across 2 the same. So after 20 minutes of Linux config file hell we track down the error logs (which are all being pumped into one file, no daily rotation - so we have to fight through a 400MB log file - joy!).

To cut a long story short, the error was coming from the advuser module. The problem was a call to the t (the translation function) which was occurring in a constant definition at the top of the page. It was therefore being called even on cached page views - and since cached page views DO NOT BOOTSTRAP the whole of Drupal, the t function was not available.

So problem solved by turning the module off :) - I actually did a quick check and the problem with the advuser module has been resolved in the latest release.

So the moral of the story. DON'T PANIC and you'll be alright so long as you know where your log files are.