25 Oct'15

Installing Redis from source on ARM

Ubuntu has quite old packages in the default repositories. It is especially important for web development, where version compatibility may break often.

ownCloud requires a modern version of Redis to use it as a cache and to keep track of the file locks.

PPAs that provide Redis packages do not build for the ARM arch, however. Therefore, with my new Scaleway server, I’ll have to do it by hand:

apt build-essential
apt libjemalloc-dev

Here, apt is my handy alias apt="sudo apt-get install". If you ran into jemalloc problems before this article, be sure to perform a distclean before re-attempting a new build:

make distclean
make

If this fails as well, then try the libc allocator:

make distclean
MALLOC=libc make

But I had success with the default allocator, so most probably you won’t have to resort to this hack.

After a successful build, be sure to run make test that should give you a similar output:

unit tests on ARM

Whoa, easy, Redis! Did you just call my quad-core ARM server a slow computer?

I had a stack trace generation test failure but I ignored it and went ahead as it is just a logging feature:

sudo make install
sudo ./utils/install_server.sh

The server should be running, you can restart it this way:

sudo service redis_6379 restart

Finally, the Redis client for PHP needs to be updated (once other packages get updated, it might be the only thing you might need to do):

apt-get install php-pear php5-dev libpcre3-dev
pear upgrade -Z
pecl install -Z redis

Ignore the segfault (it seems to be a known bug, having its roots in the PHP itself), as the packages were upgraded successfully.

You may need to service php5-fpm restart by hand.

Comments