Gearman, Memcached, PHP Gearman PECL

Februar 27th, 2010

This a short Tutorial on Howto Install Gearman with libdrizzel, libmemcached and the Gearman PHP PECL Extension on Debian. It also works on Ubuntu, you just have to use the sudo wrapper.
I presume you have a complete LAMP Stack, gcc, g++ and make installed.

Installing required libs

apt-get install memcached php5-memcache php5-dev
apt-get install libevent-dev uuid-dev autoconf

Getting the Files you need


Note: I know that there is Gearman 0.12, but this currently doesn’t work with the PHP PECL Client.
See the Google Group Discussion here:

Installing libdrizzle

tar -xzvf libdrizzle-0.7.tar.gz
cd libdrizzle-0.7
make install

Installing libmemcached

tar -xzvf libmemcached-0.38.tar.gz
cd libmemcached-0.38
make install

Installing Gearmand

tar -xzvf gearmand-0.11.tar.gz
cd gearmand-0.11
make install

Installing PHP Gearman PECL Extension

pecl install --force gearman

Loading PECL Extension

nano /etc/php5/apache2/php.ini

Look for the Dynamic Extensions Section and add

After that the Webserver must be restarted.

Starting the gearmand Deamon

/usr/local/sbin/gearmand --pid-file=/var/run/ --log-file=/var/log/gearman.log --job-retries=3 -d -u root

Starting the gearmand Deamon (with libdrizzle)

/usr/local/sbin/gearmand --pid-file=/var/run/ --log-file=/var/log/gearman.log --job-retries=3 -d -u root -q libdrizzle --libdrizzle-host= --libdrizzle-user=gearman --libdrizzle-password=mysqlpasswd --libdrizzle-db=gearman --libdrizzle-table=gearman_queue --libdrizzle-mysql

Note: If the MySQL settings are no correct, the Deamon will not start and also not throw an exception. So if you are using libdrizzle and the server does not start, check your mysql settings!

gearmand doesn’t start complaining about missing shared objects (.so)
Check your library include path.

nano /etc/

this should look like this:

# libc default configuration

Then try


fixed it for me :).

Entry Filed under: Linux,Software,Webentwicklung

Leave a Comment


Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed

Random Wisdom

“I would love to change the world, but they won't give me the source code ”