给PHP安装amqp扩展

有史以来最坑爹的一次扩展安装,不晓得诸位有没有尝试过…………各种报错啊!有木有?!¥#@%%&*……

捣鼓半天,只编译了个0.1.x的扩展版本,瞅了下,擦,函数少的可怜啊- -||| 

不行,继续~

经过一天的努力,老天总算开眼了,赶紧总结下吧~

----------------------------------------------- 我是分割线 ---------------------------------------------------

AMQP——高级消息队列协议,目前比较有名气的实现大概就是大名鼎鼎的RabbitMQ了。

(不了解的童鞋先看下我这篇转载吧:《[RabbitMQ+Python入门经典] 兔子和兔子窝》

PHP扩展当然还是官方推荐的好了。OK,就它了 http://php.net/manual/en/book.amqp.php 

To install the AMQP PHP extension, you must first install the » librabbitmq library. You will need the 0-9-1 version of the rabbitmq-c client library, linked to the rabbitmq-codegen version that corresponds to the version of the broker you are using. Use the following steps to download and install the library:


  # Download the rabbitmq-c library @ version 0-9-1

  hg clone http://hg.rabbitmq.com/rabbitmq-c/rev/b01825ecc112 rabbitmq-c

  cd rabbitmq-c

  # Add the codegen requirement. To find the full list, go here: http://hg.rabbitmq.com/rabbitmq-codegen/tags

  # and copy the URL for the appropriate broker version.

  hg clone http://hg.rabbitmq.com/rabbitmq-codegen/rev/16bbcb711380 codegen

  # Configure, compile and install

  autoreconf -i && ./configure && make && sudo make install

扩展是C写的,由于C与RabbitMQ通信一般需要依赖rabbitmq-c库(也就是librabbitmq),所以编译扩展前需要先装依赖库。好吧,那就按要求装吧~

原文是用hg工具,需要装mercurial(一个轻量级的版本控制系统),这里就不介绍了,我

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 8
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值