Hasin Hayder has posted a complete guide to getting Gearman and PHP playing nicely together. The guide gives you a step by step (and command by command) list to follow so you don't have the same pains he did trying to get it working.
I had a pretty rough evening today. No, not because the waiter forgot to add sugar in my tea, but because it was so boring to go through the trial and errors of installing gearman daemon and pecl gearman extension for php.
He walks though the whole process, starting with the failures, that he took getting it installed. Unfortunately it wasn't just as easy as installing a package and using PECL to drop in the extension. There was other software packages that needed to be installed as well and were a bit harder to figure out - libboost, gperf, libevent, uuid-dev and libcloog-ppl-dev. With these installed, the PECL install command was finally able to build and he got the shared module he needed.