1 .安装gearmand服务
官网
访问官网:https://launchpad.net/gearmand
右侧下载
# wget https://launchpad.net/gearmand/1.2/1.1.12/+download/gearmand-1.1.12.tar.gz
# tar -zxvf gearmand-1.1.12.tar.gz
# cd gearmand-1.1.12
# ./configure
# make && make install
2. 安装gearman扩展
访问官网:https://pecl.php.net/
找到 gearman 扩展地址 最新稳定版本
下载地址
# wget https://pecl.php.net//get/gearman-1.1.2.tgz
# tar -zxvf gearman-1.1.2.tgz #这里需要解压到你的PHP源代码的ext目录下
# /usr/local/php/bin/phpize #生成configure文件
# ./configure --with-php-config=/usr/local/php/bin/php-config
# make
# make test
# make install
然后去php.ini 中添加
extensio=gearman.so
执行
php -m | grep 'gearman'