Skip to main content

CentOS4 and CiviCRM 2.1

With the new year, a new resolution to upgrade some sites to the new CiviCRM 2.1. CiviCRM 2.1 is particularly special because it requires Drupal 6 and it's the first version that supports Drupal 6. So upgrades of existing Drupal 5 sites are difficult, particularly if any custom modules or themes involved.
As it turned out, my procrastination was justified. I asked my friend Rob Ellis to help with Maquila Solidarity Network, who I've been working with for a few months, and who decided that the new features in 2.1 were too good to postpone any longer. Rob did the upgrade and discovered two issues on my CentOS 4 server:
  • The CiviCRM installer insists on PHP 5.2.x
  • CiviCRM requires a version of PCRE with unicode
None of this sounds very interesting, and I wouldn't post about it, except that I would have thought it wouldn't be as hard to fix as it was. So here's what I did, in case there's someone else out there with CentOS4 (or RHEL4) trying to run CiviCRM 2.1.
Running CiviCRM 2.1 on a normal CentOS4
The original RHEL4 (and hence CentOS4) comes with php4, which is really not okay any more, but the CentOS 'extras' repository has php 5.1, which is what I've been using for the past 2 years on this server. Unfortunately, there don't seem to be any plans to upgrade this to 5.2.
From my brief reading, it looked like there wasn't a big difference from 5.1 to 5.2, and the CiviCRM maintainers didn't promise that it wouldn't work on 5.1. So the first thing Rob did was just fiddle with a couple of installation files to allow the installation to procede with 5.1. Not too surprisingly, it worked, almost.
What actually created errors, was a problem with PCRE, which is the Perl Regular Expression library. So, rob found the file that was generating the errors (packages/IDS/Converter.php) and patched it in a few places (hey, it's an external library) where it thought it cared about unicode, and voila, it worked.
Conclusion: CiviCRM 2.1 can run with slight modifications on CentOS4 (and RHEL4). Yay rob!
On The Other Hand
But I really didn't relish maintaining these modifications to CiviCRM through multiple installs and upgrades, and updating my php to 5.2 and my pcre to unicode both seemed like sensible things to do. Whether it was sensible remains to be seen, but here's how I did it.
PHP 5.2.x on CentOS4
When I googled this, I ended up being pointed to a repository called "utter ramblings", which I tried to use. While I appreciate the work Jason did on this, it didn't work. The problem arose that his upgrade also required a version of a library on which subversion depended, and he chose the standard CentOS/RHEL4 version of subversion, so his upgrade was incompatible with my up to date subversion package from Dag. I also just wasn't quite convinced that he really wanted to be keeping his repository going for a long time. As an aside, the php upgrade also thought it needed to upgrade my apache to 2.2, which wasn't a bad thing, but made the whole upgrade a little more risky and complicated.
There was another repository by a french-speaking guy called 'remi' that many people praised, but I found myself shying away from it also, based on a fear of language confusion and the fact that he was hosting his repository on a domain called 'family collette'. This was probably unfounded paranoia on my part, and his repository might have been completely adequate.
What I did end up finding, though much less prominent, is the 'atomic rocket turtle' repository, which you might think i'd avoid even more because of it's name. But it was very impressive technically - he must have a pretty good understanding of what he's doing and a good automatic build environment because he had the latest version of php 5.2 compiled shortly after it had come out in December.
So - i just followed the instructions, ran the update and it did a nice clean minimal update of php 5.2 and just a couple of small dependencies that didn't break anything else.
Of course, I had to upgrade my version of APC, but that was to be expected since I don't maintain it from YUM.
PCRE with Unicode on CENTOS4
I had hoped my php 5.2 upgrade would solve the pcre problem, but it didn't. That was because the php installed (as well as the previous one - presumably a CentOS/RHEL standard) uses the option that tells php to use the installed OS library. So I had to go learn about my CentOS version of PCRE (which was dated 2003) and why it didn't support unicode.
That turned out to be confusing on google, because it seems I'm not the only one to be messed up about the difference between UTF-8 and unicode. The version I had did have UTF-8. but not unicode support.
The solution turned out to be a combination of these two posts:
Look for "Add Unicode Properties Support to PCRE".
The only problem with it was it was for the wrong version of CentOS, so I found:
which pointed me at a broken link for a fedora 6 src rpm, which i eventually found here:
Using that, with jason huck's instructions, turned out to work just fine.
Conclusion: you can update your CentOS4 to run CiviCRM 2.1 without modification, though some assembly is required. Specifically: recompiling source RPMs.


Friends General said…
Hey - found this post helpful. Got as far as upgrading my testing server to PHP 5.2 - only to find this post.
Looks like they 5.2 requirement is arbitrary - at least for CiviCRM 2.1. I've found people who disabled the version check, and haven't had any problems.
Alan Dixon said…
True, but you're probably better off with 5.2 - there are enough mysteries with CiviCRM to not have another potential source of confusion. The other big reason that it's good to upgrade to 5.2 is the Drupal date module.
Anonymous said…
You made my morning. This totally helped me out.


Popular posts from this blog

Varnish saves the day, in unexpectedly awesome ways.

Four and half years ago, I wrote a blog post about Varnish, a 'front-end proxy' for webservers. My best description of it then was as a protective bubble, analogous to how it's namesake is used to protect furniture. I've been using it happily ever since.

But last week, I got to really put Varnish through a test when the picture here, posted by Fair Vote Canada (one of my clients), went viral on Facebook. And Varnish saved the server and the client in ways I didn't even expect.

1. Throughput

Varnish prides itself on efficiently delivering http requests. As the picture went viral, the number of requests was up to about 1000 per minute, which Varnish had no trouble delivering - the load was still below 1, and I saw only a small increase in memory and disk usage. Of course, delivering a single file is exactly what Varnish does best.

2. Emergency!

Unfortunately, Varnish was not able to solve a more fundamental limitation, which was the 100Mb/s network connection. Becaus…

What to do in the age of Trump?

Well, that's the question of the day. If you're part of an organization that does advocacy work, rather than waiting to see what happens first, might as well get yourself ready, even if the details are sketchy still. Here's one opportunity that's ready for you now, message courtesy of Steve Anderson of OpenMedia.

OpenMedia, David Suzuki Foundation, SumOfUs and a range of other organizations are supporting a new shared set of civic engagement tools.

Vancity Community Foundation is providing some support to subsidize some of the cost of the tools to select values-aligned organizations that sign up before February 28th.

Interested? You can learn more or book a demo from here:

Here's some live examples of the tools you can take a look at:

1. Click to Call:

Check out this video of David Suzuki's d…

Me and varnish win against a DDOS attack.

This past month one of my servers experienced her first DDOS - a distributed denial of service attack. A denial of service attack (or DOS) just means an attempt to shut down an internet-based service by overwhelming it with requests. A simple DOS attack is usually relatively easy to deal with using the standard linux firewall called iptables.  The way iptables works is by filtering the traffic based on the incoming request source (i.e., the IP of the attacking machine). The attacking machine's IP can be added into your custom ip tables 'blacklist' to block all traffic from it, and it's quite scalable so the only thing that can be overwhelmed is your actual internet connection, which is hard to do.

The reason a distributed DOS is harder is because the attack is distributed from multiple machines. I first noticed an increase in my traffic about a day after it had started - it wasn't slowing down my machine, but it did show up as a spike in traffic. I quickly saw that…