Thursday, 24 September 2009

Weekly update #11

Days worked this week: 1.3 Days

Due to holiday/other work commitments, I've not worked on the website for a couple of months now, so was relieved to see that the me of two months ago had kindly written some notes for the me of today, on the kinds of things I'd have forgotten about while away.

Before I could even start reminding myself how Drupal worked and carry on working on the site, I was stumped at the first hurdle* when I discovered Drupal's dreaded White Screen of Death (WSOD) on the Modules page (admin/build/modules) for my site.

I spent about a day trying to fix this, and found this page on the Drupal site to be particularly useless, given that its first solution to 'admin/build/modules' giving a blank page involves going to 'admin/build/modules' and changing some settings. How on earth are you meant to do that if it's blank?!

I've had this problem before and it's usually fixed by running update.php (which is done by visiting 'http://www.example.com/update.php' , where 'www.example.com' is changed to the URL of your website), as well as running Cron (which you can do from www.example.com/admin/reports/status). This normally magically fixes problems like this, but that wasn't making any difference. I'd also increased the PHP memory limit to 96MB, as recommended on this page and this one, which aside from the flaw mentioned previously, seemed to be the most knowledgeable Help pages on this error. This hadn't fixed the problem either, so I was starting to worry.

Fortunately a friend of mine knows his stuff when it comes to Drupal, and worked out what the problem was within minutes. He worked it out by viewing the error log in MAMP, which is what i'm using on my Apple laptop to run the laptop as a virtual server while I develop the site. To find this log, you'll need to navigate somewhere like here in Finder (if using OSX) - not sure where it would be if in Windows:

Applications>MAMP>logs>php_error.logs

Right-click that .logs file and open in 'Console' (not sure what the Windows equivalent is. possibly 'Terminal'?). Once Console has fired up, you may need to navigate on the left side of it to the 'php_error.log' file. The errors shown here are shown in order of date and time, so scroll around until you find the time you tried looking at the Modules page to find it blank. In this particular case I was getting the following message:

PHP Fatal error: Only variables can be passed by reference in /.../.../.../.../sites/all/modules/admin_menu/admin_menu.inc on line 536

[I've edited that error message slightly to remove irrelevant bits of the address, that relate to where specifically on my computer the file path is]

This gave the clue that the Administration Menu Module (or 'admin menu' as it's sometimes referred to), was causing problems. Indeed, when temporarily moving the 'admin_menu' folder out of my 'sites/all/modules' folder (which is where you should be keeping your modules), I could then access the Modules section on my website, so problem solved!

When I say 'problem solved', of course it's not entirely. Although the Administration Menu Module isn't essential for site development, it is one of the most useful modules out there, and I'm now left without it. Looking at their web page, it looks like there's a general problem with this module that I don't think is their fault, so here's hoping that gets fixed soon.



*Am I mixing two sports there, cricket and horse racing, or is that a real phrase?

No comments:

Post a Comment