Linux, php

Install Gearman Module to Ubuntu Xenial with PHP 7

The Gearman PHP module is the last piece of dependency missing in our stack before we can consider moving to PHP7. I’m currently testing Ubuntu 16.04 Xenial on PHP7 and unfortunately, the gearman module is not yet available on official repo. To proceed testing, I just compile it in my Docker image.

I’m installing the Gearman client on top of my existing PHP7 + Apache container on Docker hub:

The idea to compile it is based on this thread:

Here is the additional commands to run to install the Gearman module.

# Install additional packages for compiling
apt-get -y install wget unzip re2c libgearman-dev

# Install from source
mkdir -p /tmp/install
cd /tmp/install
cd pecl-gearman-master
make install
echo "" > /etc/php/7.0/mods-available/gearman.ini
phpenmod -v ALL -s ALL gearman
rm -rf /tmp/install/pecl-gearman-master
rm /tmp/install/

# Verify if module is really installed
php -m | grep gearman

While waiting for the official release, will live with manually compiling it.

Enjoy and share!

2 thoughts on “Install Gearman Module to Ubuntu Xenial with PHP 7”

Leave a reply

Your email address will not be published. Required fields are marked *