Upgrading ICU to Install OroCRM on CentOS 5

Recently the crew over at Classy Llama decided to finally jump on board the OroCRM train and begin the process of implementing the software for our own internal use. Sometimes I’m known as the server dude internally, and that’s exactly how I come into play in this endeavor. The question always must be answered, where will we host it? In my neck o’ the woods we run our software on old-fashioned bare-metal servers, which does mean we have some older software than I’d like at times. And the server we’ve got over here which will have OroCRM added to it’s responsibility list is one of those machines which has been around a few years. It’s running CentOS 5 still! Who runs CentOS 5? Yeah. Old. And with OroCRM being a modern piece of software and all, it quickly became upgrade time.

What needed upgrading? A few things. PHP, MySql… and ICU. The first two were obvious, and needed to be upgraded anyways, so I did, missing the latter. Found that one when I tried to run composer install on the code to deploy it. OroCRM uses a Symfony component which requires ICU v4.4 or higher. The latest packaged version available in this case is v3.6. Even CentOS 6 only has packages for ICU v4.2! Solution? Turns out it’s not all that complicated. Install our own versions of ICU and the PHP intl extension compiled against this version of the ICU lib.

In my case, I chose to install ICU 4.4 instead of the latest version since there are pre-compiled binaries of ICU 4.4 for CentOS 5 available on http://site.icu-project.org. Were I running CentOS 6 I would have most likely gone with the very latest version of ICU.

Here’s how… (running as root):

# remove the php-intl package built against the native icu version
yum remove php-intl

# make sure we have the developer packages needed for procedure
yum -y install php-devel php-pear

# download and unpackage tar which code for relevant ICU lib version
mkdir src
cd src/
wget http://download.icu-project.org/files/icu4c/4.4.2/icu4c-4_4_2-src.tgz
tar zxf icu4c-4_4_2-src.tgz

# build and install the library into /opt/icu4c-44_2
cd icu/source/
./configure --prefix /opt/icu4c-44_2 && make && make install

# build and install the php-intl version
# enter /opt/icu4c-44_2 at prompt for ICU library location
pecl install intl
ldconfig

# add an ini file wity contents: extension=intl.so
vi /etc/php.d/intl.ini

# you can now check to see if it's loaded
php -i | grep intl

# restart the apache web server and you're good to go
service httpd restart

Now go have fun playing with your new OroCRM setup!