簡體   English   中英

通過PECL安裝AMQP

[英]Installing AMQP through PECL

我正在嘗試安裝RabbitMQ PECL擴展但運行后

sudo pecl install amqp

我得到以下神秘的錯誤消息,廣泛的谷歌搜索沒有幫助解決。

我安裝了這些軟件包:

  • librabbitmq - RabbitMQ C客戶端本身)
  • librabbitmq-dev - dev頭等

和RabbitMQ在localhost上成功運行

也許它可能是C客戶端版本的不匹配以及PECL擴展所期望的,其他人遇到過這個嗎?

在下方輸出....

干杯

running: make
/bin/bash /tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/libtool --mode=compile cc  -I.         -I/tmp/pear/temp/amqp -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootZNUmac/amqp-        1.0.0/include -I/tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/main -I/tmp/pear/temp/amqp -      I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -       I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -    D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/amqp/amqp.c -o amqp.lo
libtool: compile:  cc -I. -I/tmp/pear/temp/amqp -DPHP_ATOM_INC -I/tmp/pear/temp/pear-   build-rootZNUmac/amqp-1.0.0/include -I/tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/main -   I/tmp/pear/temp/amqp -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -  I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -  D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c    /tmp/pear/temp/amqp/amqp.c  -fPIC -DPIC -o .libs/amqp.o
/bin/bash /tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/libtool --mode=compile cc  -I.    -I/tmp/pear/temp/amqp -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootZNUmac/amqp-  1.0.0/include -I/tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/main -I/tmp/pear/temp/amqp -   I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -   I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -   D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -DHAVE_CONFIG_H  -g -O2   -c     /tmp/pear/temp/amqp/amqp_exchange.c -o amqp_exchange.lo
libtool: compile:  cc -I. -I/tmp/pear/temp/amqp -DPHP_ATOM_INC -I/tmp/pear/temp/pear-   build-rootZNUmac/amqp-1.0.0/include -I/tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/main -  I/tmp/pear/temp/amqp -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -  I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -   D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c   /tmp/pear/temp/amqp/amqp_exchange.c  -fPIC -DPIC -o .libs/amqp_exchange.o
/bin/bash /tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/libtool --mode=compile cc  -I.  -I/tmp/pear/temp/amqp -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootZNUmac/amqp- 1.0.0/include -I/tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/main -I/tmp/pear/temp/amqp -  I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM - I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -DHAVE_CONFIG_H  -g -O2   -c  /tmp/pear/temp/amqp/amqp_queue.c -o amqp_queue.lo
libtool: compile:  cc -I. -I/tmp/pear/temp/amqp -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/include -I/tmp/pear/temp/pear-build-rootZNUmac/amqp-1.0.0/main -   I/tmp/pear/temp/amqp -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -  I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -   D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c            /tmp/pear/temp/amqp/amqp_queue.c  -fPIC -DPIC -o .libs/amqp_queue.o
/tmp/pear/temp/amqp/amqp_queue.c: In function 'read_message_from_channel':
/tmp/pear/temp/amqp/amqp_queue.c:316:11: error: 'AMQP_FIELD_KIND_U64' undeclared (first use in this function)
/tmp/pear/temp/amqp/amqp_queue.c:316:11: note: each undeclared identifier is reported only once for each function it appears in
/tmp/pear/temp/amqp/amqp_queue.c: In function 'zim_amqp_queue_class_nack':
/tmp/pear/temp/amqp/amqp_queue.c:1020:2: error: unknown type name 'amqp_basic_nack_t'
/tmp/pear/temp/amqp/amqp_queue.c:1039:3: error: request for member 'delivery_tag' in something not a structure or union
/tmp/pear/temp/amqp/amqp_queue.c:1040:3: error: request for member 'multiple' in something not a structure or union
/tmp/pear/temp/amqp/amqp_queue.c:1041:3: error: request for member 'requeue' in something not a structure or union
/tmp/pear/temp/amqp/amqp_queue.c:1046:3: error: 'AMQP_BASIC_NACK_METHOD' undeclared     (first use in this function)
make: *** [amqp_queue.lo] Error 1
ERROR: `make' failed

我必須安裝它應用發現以下步驟在這里

 # Download the rabbitmq-c library @ version 0-9-1
 git clone git://github.com/alanxz/rabbitmq-c.git
 cd rabbitmq-c
 # Enable and update the codegen git submodule
 git submodule init
 git submodule update
 # Configure, compile and install
 autoreconf -i && ./configure && make && sudo make install

之后, sudo pecl install amqp完成了工作。

使用Ubuntu 12.10和PHP 5.4.3。

這就是我在debian wheezy上成功安裝它所做的事情:

apt-get install pkg-config librabbitmq-dev librabbitmq0

git clone https://github.com/alanxz/rabbitmq-c
cd rabbitmq-c/
autoreconf -i
./configure
make
make install
pecl install amqp

回購的開發工具被打破(通常......)。 你必須克隆(從GIT或HG)並從php.net制作lib:

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

然后運行“pecl install amqp”,在我的ubuntu 12中運行Php 5.3

這就是我在debian wheezy上成功安裝它所做的:我不得不使用rabbitmq-c的0.5.2版本

git clone https://github.com/alanxz/rabbitmq-c
cd rabbitmq-c
git checkout tags/v0.5.2
git submodule init
git submodule update
autoreconf -i && ./configure && make && make install
pecl install amqp

看起來PECL擴展比您安裝的庫更新。 直接從他們的網站上安裝RabbitMQ,使用他們的軟件包,而不是隨您的發行版附帶的軟件包,因為它們似乎已經過時了。

這是因為你的rabbitmq比php擴展所需的版本舊。

您可以安裝較新版本的rabbitmq或更低版本的擴展名:

pecl install amqp-1.2.0

但我認為使用最新版本是更好的選擇。

使用帶有PHP7.0的pecl安裝rabbitmq的AMQP

只需遵循這些步驟,這將安裝其所有依賴項和amqp庫。 它適用於使用php7.0 bento/ubuntu-16.04

apt-get update

wget http://in.archive.ubuntu.com/ubuntu/ubuntu/pool/universe/libr/librabbitmq/librabbitmq1_0.5.2-2_amd64.deb
dpkg -i librabbitmq1_0.5.2-2_amd64.deb

wget http://in.archive.ubuntu.com/ubuntu/ubuntu/pool/universe/libr/librabbitmq/librabbitmq-dev_0.5.2-2_amd64.deb
dpkg -i librabbitmq-dev_0.5.2-2_amd64.deb

apt-get install php7.0 php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-xml php7.0-dev

pecl install amqp

echo "extension=amqp.so" >> /etc/php/7.0/cli/php.ini
echo "extension=amqp.so" >> /etc/php/7.0/fpm/php.ini

Librabbitmq-dev及其可以從中下載的不同版本的依賴項

http://in.archive.ubuntu.com/ubuntu/ubuntu/pool/universe/libr/librabbitmq/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM