I've been helping a friend setup gearman on his box; unfortunately his box happens to be running Ubuntu 10.04 Lucid Lynx LTS which has some packaging problems with gearman. This post is a quick list of the things we did to fix the pecl installation of gearman-beta and to get it running.
First, the Ubuntu dependencies
sudo apt-get install gearman libgearman2 libgearman-dev \ php5-dev php-pear
Second, Edit a file
(This is due to packaging changes that occurred in Lucid.)
sudo vi /usr/lib/libgearman.la
replace dependency_libs=' -L/usr/lib /usr/lib/libuuid.la'
with dependency_libs=' -L/usr/lib -luuid'
sudo pecl install gearman-beta
Fourth, Add Configuration to PHP
(optional if you have pecl configured to your php.ini files)
sudo echo 'extension=gearman.so' > /etc/php5/conf.d/gearman.ini
php -m |grep gearman
If this doesn't return anything you have a problem somewhere. If it returns gearman than you're good, just restart apache and you're done.