在Ubuntu上部署Gearman

sudo apt-get 中没有gearmand,所以用wget下载

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

configure: error: could not find boost

sudo apt-get install libboost-dev

接着重新执行:./configure

configure: error: Could not find a version of the library!

sudo apt-get install libboost-all-dev

接着重新执行:./configure

configure: error: could not find gperf

sudo apt-get install gperf*

接着重新执行:./configure

configure: error: Unable to find libevent

sudo apt-get install libevent-dev

接着重新执行:./configure

configure: error: Unable to find libuuid

sudo apt-get install uuid-dev


./configure

sudo make 

sudo make install


这里要等一段时间。。



gearman

第一次运行会看到以下提示:

gearman: error while loading shared libraries: libgearman.so.8: cannot open shared object file: No such file or directory

(这表示系统不知道libgearman.so.8 放在哪个目录下。 要在/etc/ld.so.conf中加入libgearman.so.8所在的目录。 检查了下,文件所在目录为/usr/local/lib。 因此出现这个问题的原因是libgearman.so.8刚生成,没有加入到ld.so.cache中,所以这时需要重新运行一下 /sbin/ldconfig( ldconfig命令的作用):)

sudo /sbin/ldconfig

此时再执行 gearman 则已安装成功!

安装完Job Server之后,用gearmand –d命令启动

gearmand -d

第一次运行会看到以下提示:

gearmand: Could not open log file "/usr/local/var/log/gearmand.log", from "/home/wangyulu/下载/gearmand-1.1.12", switching to stderr. (No such file or directory)

在提示的目录下创建好/log/gearmand.log文件,再次执行上述命令,就正常启动了job server。

sudo gearmand -d

到这里就已经完全ok了



安装PHP Gearman扩展

wget http://pecl.php.net/get/gearman-1.1.2.tgz

sudo tar zxvf gearman-1.1.2.tgz

cd gearman-1.1.2/

sudo phpize (这里可能会提示没有此命令,执行 sudo apt-get install php5-dev 安装)

sudo ./configure

sudo make

sudo make install

sudo echo "extension=gearman.so" >> /etc/php5/apache2/php.ini (注意这里php.ini位置)

sudo /etc/init.d/apache2 restart

这时查看php_info时就应该看到 gearman扩展了
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值