Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been trying to get Gearman compiled on CentOS 5.8 all afternoon. Unfortunately I am restricted to this version of CentOS by my CTO and how he has our entire network configured. I think it's simply because we don't have enough resources to upgrade our network... But anyways, the problem at hand.

I have searched through Server Fault, Stack Overflow, Google, and am unable to locate a working solution. What I have below is stuff I have pieced together from my searching.

Searches have told said to install the following via yum:

yum -y install --enablerepo=remi boost141-devel libgearman-devel e2fsprogs-devel e2fsprogs gcc44 gcc-c++

To get the Boost headers working correctly I did this:

cp -f /usr/lib/boost141/* /usr/lib/
cp -f /usr/lib64/boost141/* /usr/lib64/
rm -f /usr/include/boost
ln -s /usr/include/boost141/boost /usr/include/boost

With all of the dependancies installed and paths setup I then download and compile gearmand-1.1.2 just fine.

wget -O /tmp/gearmand-1.1.2.tar.gz
cd /tmp && tar zxvf gearmand-1.1.2.tar.gz
./configure && make -j8 && make install

That works correctly. So now I need to install the Gearman library for PHP. I have attempted through PECL and downloading the source directly, both result in the same error:

checking whether to enable gearman support... yes, shared
not found
configure: error: Please install libgearman

What I don't understand is I installed the libgearman-devel package which also installed the core libgearman. The installation installs libgearman-devel-0.14-3.el5.x86_64, libgearman-devel-0.14-3.el5.i386, libgearman-0.14-3.el5.x86_64, and libgearman-0.14-3.el5.i386.

Is it possible the package version is lower than what is required? I'm still poking around with this, but figured I'd throw this up to see if anyone has a solution while I continue to research a fix.


share|improve this question
gearmand is in the EPEL repo for EL5. For that matter, php-pecl-gearman is in remi. Why did you download your own? This is too much trouble for nothing. – Michael Hampton Oct 22 '12 at 20:43
I have a custom compiled PHP version. Installing php-pecl-gearman brings down packaged PHP versions which will conflict with my version already installed. So far the PHP library is the only thing I can't get compiled. And why the ./configure is not seeing the libgearman is beyond me. libgearman's headers are indeed located at /usr/include/libgearman... – Andrew Ellis Oct 22 '12 at 20:49
It may also be worth noting that using ./configure --with-gearman=/usr/include/libgearman also results in the same error. – Andrew Ellis Oct 22 '12 at 20:52
OK, so your web app is so old it won't run on PHP 5.3? That sucks. It would probably be easier to fix the web app and use the remi-packaged PHP (5.3.18 as of today). – Michael Hampton Oct 22 '12 at 20:53
Ouch. (You know remi-test has PHP 5.4 as well...) Doing this yourself is almost always going to backfire. – Michael Hampton Oct 22 '12 at 20:56
up vote 3 down vote accepted

This should do the trick:

export GEARMAN_LIB_DIR=/usr/include/libgearman
export GEARMAN_INC_DIR=/usr/include/libgearman

That should work, if not you'll have to do some minor edits to config.m4.

share|improve this answer
That worked! Thanks! – Andrew Ellis Oct 25 '12 at 17:00

Some other helpful notes regarding this can be found here:

And based on link above and random googling around this has worked for me without messing lib/include folders:

yum install boost141 boost141-devel gcc44 gcc44-c++ uuid-devel
export CC="gcc44"
export CFLAGS="-std=gnu99"
export CXX="gcc44-c++"
export CPPFLAGS="-I/usr/include/boost141"
export LDFLAGS="-L/usr/lib64/boost141"
CC=gcc44 CXX=g++44 ./configure
make install

UPDATE: Epel has recently updated to gearmand / libgearman 1.1.8 which is very recent compared to the version they had before (0.14?). So there should be no need to compile it by yourself (except the php pecl extension of course).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.