1、下载 Gearman 安装软件
https://launchpad.net/gearmand
2、升级或安装相关软件
yum install boost boost-devel -y
boost 的版本必须大于 1.39
3、解压和安装
tar zxvf gearmand-1.1.4.tar.gz
cd gearmand-1.1.4
./configure --prefix=/usr/local/gearmand --with-boost=/usr/local/boost
make
make install
4、启动Gearman
/usr/local/gearmand/sbin/gearmand -d -u root -l /usr/local/gearmand/data/gearmand.log -P /usr/local/gearmand/data/gearmand.pid
5、把Gearman 加到 机器重启程序也启动
打开 /etc/rc.local 文件
添加 :
/usr/local/gearmand/sbin/gearmand -d -u root -l /usr/local/gearmand/data/gearmand.log -P /usr/local/gearmand/data/gearmand.pid
下载安装php扩展
1、下载PHP Gearman的扩展
http://pecl.php.net/get/gearman-1.1.1.tgz
2、解压和安装
tar zxvf gearman-1.1.1.tgz
cd gearman-1.1.1
/usr/local/php/bin/phpize
./configure –with-gearman=/usr/local/gearmand/ –with-php-config=/usr/local/php/bin/php-config
make
make install
3、打开 php.ini 添加如下一行
extension=gearman.so
转载自http://luhuang.sinaapp.com/linux-php-gearman/