第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

Linux下給PHP安裝amqp擴(kuò)展

標(biāo)簽:
PHP

原文链接

本文介绍了在Linux下给PHP安装amqp扩展的过程,有需要的朋友可以关注一下。

安装librabbitmq-c和rabbitmq-codegen

# 下载0-9-1版的rabbitmq-cgit clone git://github.com/alanxz/rabbitmq-c.gitcd rabbitmq-c# Enable and update the codegen git submodulegit submodule init
git submodule update# Configure, compile and installautoreconf -i && ./configure && make && sudo make install

安装pecl扩展

#下载最新的amqp扩展wget http://pecl.php.net/get/amqp-1.0.9.tgz
tar xvzf amqp-1.0.9.tgz
cd amqp-1.0.9 && phpize
./configure --with-amqp && make && sudo make install

记得在php.ini中加入amqp扩展:

extension=amqp.so

安装过程中可能会遇到的问题

1、缺少libtool包

configure.ac: installing ./install-sh
configure.ac: installing ./missingconfigure.ac:34: installing ./config.guess
configure.ac:34: installing ./config.sub
Makefile.am:3: Libtool library used but LIBTOOL is undefined
Makefile.am:3:
Makefile.am:3: The usual way to define LIBTOOL is to add AC_PROG_LIBTOOL
Makefile.am:3: to configure.ac and run aclocal and autoconf again.
Makefile.am: C objects in subdir but AM_PROG_CC_C_O not in configure.ac
Makefile.am: installing ./compile
Makefile.am: installing ./depcomp
autoreconf: automake failed with exit status: 1

解决办法,安装libtool,ubuntu:

sudo apt-get install libtool

其他系统类似

2、如果还有其他问题,欢迎给我留言,我补上

使用

<?php//配置信息$conn_args = array(    'host' => '127.0.0.1',    'port' => '5672',    'login' => 'guest',    'password' => 'guest',    'vhost'=>'/');//创建连接$conn = new AMQPConnection($conn_args);if (!$conn->connect()) {    die('Not connected  ' . PHP_EOL);
}// Open Channel$channel = new AMQPChannel($conn);// Declare exchange$exchange = new AMQPExchange($channel);
$exchange->setName('extest');
$exchange->setType('fanout');
$exchange->declare();// Create Queue$queue = new AMQPQueue($channel);
$queue->setName('qutest');
$queue->declare();// Bind it on the exchange to routing.key$exchange->bind('qutest', 'routing.key');
$data = array(    'Name' => 'foobar',    'Args'  => array("0", "1", "2", "3"),
);//生产者,向RabbitMQ发送消息$message = $exchange->publish(json_encode($data), 'key');if (!$message) {    echo 'Message not sent', PHP_EOL;
} else {    echo 'Message sent!', PHP_EOL;
}//消费者while ($envelope = $queue->get(AMQP_AUTOACK)) {    echo ($envelope->isRedelivery()) ? 'Redelivery' : 'New Message';    echo PHP_EOL;    echo $envelope->getBody(), PHP_EOL;
}?>


點(diǎn)擊查看更多內(nèi)容
TA 點(diǎn)贊

若覺(jué)得本文不錯(cuò),就分享一下吧!

評(píng)論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評(píng)論
  • 收藏
  • 共同學(xué)習(xí),寫(xiě)下你的評(píng)論
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說(shuō)多少就多少
贊賞金額會(huì)直接到老師賬戶(hù)
支付方式
打開(kāi)微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊(cè)有機(jī)會(huì)得

100積分直接送

付費(fèi)專(zhuān)欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會(huì)
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

舉報(bào)

0/150
提交
取消