在Linux上安装Gearman及配置使用Gearman的PHP扩展环境

本文介绍了如何在Linux系统中成功安装Gearman,并详细讲述了如何启动和停止Gearman服务,以及如何配置使用Gearman的PHP扩展。通过指定log-file参数设置日志文件,确保了服务的正常运行。完成这些步骤后,你就成功配置了使用Gearman的PHP环境。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在Linux上安装Gearman及配置使用Gearman的PHP扩展环境。


先介绍安装 Gearman 。

1. 先安装依赖库
# yum install -y boost-devel gperf libevent-devel libuuid-devel

2. 下载 Gearman
下载:
# wget https://launchpad.net/gearmand/1.2/1.1.12/+download/gearmand-1.1.12.tar.gz
解压:
# tar -xzvf gearmand-1.1.12.tar.gz 

3. 配置 Gearman
# cd gearmand-1.1.12
# pwd
/data/gearmand-1.1.12
# ./configure
...
checking for boostlib >= 1.39... configure: We could not detect the boost libraries (version 1.39 or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option.  If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.
configure: error: could not find boost

如果出现上面错误,先检查当前安装的Boost版本是否 >= 1.39,如果版本低,就需要安装高版本的Boost。
如果已经安装了Boost,就先卸载再安装;如果版本 >= 1.39,也出现上面错误,也卸载再安装。
安装Boost:
# yum install boost  
# yum install boost-devel  
# yum install boost-doc

再执行配置:
# ./configure

4. 编译 Gearman
# pwd
/data/gearmand-1.1.12
# make
...
  CXX      util/gearmand_hostile_gearmand-daemon.o
  CXX      util/gearmand_hostile_gearmand-pidfile.o
  CXX    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值