I’ve just built a new server for a client, so naturally – as a completionist – I wanted to install the latest and best of everything. So I did.

That includes PHP 5.3, and for a Drupal website (I’ve learnt), that’s a bad thing…. a very bad thing. So bad that you’ll wish you were a WordPress programmer…

The problem is two-fold; firstly, PHP 5.3 is a lot tighter on syntax than earlier versions (including PHP 5.2), and secondly, Drupal 6  was written to support PHP 4; OK, PHP 4 might have been the best solution way back when, but it reached End of Life at the end of 2007. Three whole years ago!

So why is this a bad thing? Simply because a lot of Drupal modules pass values by reference. This is OK in PHP 4, but PHP5.3 is sick all over the screen.

Anyway, this issue has caused me to patch quite a few modules, so I had to find out the best method. And here it is…

1. Find out the full name of the patch. For example, in http://drupal.org/node/615058#comment-3182692, there is a patch listed for Admin_menu. Write down or copy the link (in this case it’s http://drupal.org/files/issues/admin_menu.inc_6.patch)

2. SSH into your server, and  down into the modules directory, then run the following command;

wget -O - http://drupal.org/files/issues/admin_menu.inc_6.patch | patch -p0

3. The patch will be obtained and installed for you

Even if it doesn’t help you, it helps me to remember!