2012-03-01 18 views
17

sto cercando di installare il RabbitMQ PECL extension ma dopo l'esecuzioneInstallazione AMQP attraverso PECL

sudo pecl install amqp 

ottengo il seguente messaggio di errore criptico, che vasta Googling non ha aiutato a risolvere.

Ho questi pacchetti installati:

  • librabbitmq - RabbitMQ C cliente stesso)
  • librabbitmq-dev - headers dev ecc

e RabbitMQ in esecuzione con successo su localhost

Forse potrebbe essere una mancata corrispondenza nella versione del client C e quale sarà l'estensione PECL che si aspetta, qualcun altro si imbatte in questo?

uscita Marchio di seguito ....

Acclamazioni

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 
+0

ho vissuto anche questo. Su un sistema Ubuntu Lucid, ho estratto il server rabbitmq dai repository di Ubuntu e librabbitmq-dev dal PPA di Drizzle. Quindi, eseguendo 'pecl install amqp-beta' si ottiene il messaggio di errore sopra riportato. Lo stesso messaggio esatto deriva anche da 'pecl install amqp'. – Mei

+0

Oppure usa solo la libreria https://github.com/php-amqplib/php-amqplib – kervin

risposta

3

Sembra che l'estensione PECL è più recente delle librerie che avete ottenuto installati. Installa RabbitMQ direttamente dal loro sito Web, utilizzando i loro pacchetti e non quelli forniti con la tua distribuzione in quanto sembrano non aggiornati.

+0

Yep, Dopo aver esaminato la libreria RabbitMQ C, è chiaro che è sperimentale e trova una versione che verrà compilata dall'estensione PECL contro è incostante Invece sto solo andando con un'implementazione di PHP puro [php-amqplib] (https://github.com/videlalvaro/php-amqplib) Evviva – managedheap84

2

La libreria di ripristino da repository è interrotta (come di solito ....). È necessario clonare (da GIT o HG) e rendere il lib, da php.net:

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 

Poi eseguire "PECL installare AMQP", ha lavorato nel mio ubuntu 12 con PHP 5.3

+0

anche questo ha funzionato per me su 32bit 12.04 PHP 5.3. Tuttavia su 13.04 64bit PHP 5.4 l'estensione PECL compila ma caricandola in apache fornisce il seguente errore: "Avviso PHP: avvio PHP: impossibile caricare la libreria dinamica '/usr/lib/php5/20100525/amqp.so' -/usr/lib/php5/20100525/amqp.so: simbolo non definito: amqp_open_socket in Unknown alla riga 0. " Sei riuscito a farlo funzionare? Qualche idea? – nicja

23

ho dovuto installarlo applicando seguenti fasi trovato here:

# 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 

Dopo di che, sudo pecl install amqp ha fatto il lavoro.

Utilizzo di Ubuntu 12.10 con PHP 5.4.3.

+0

Nelle versioni di versioni più recenti come Ubuntu 14.04 e PHP 5.6, è necessario eseguire il checkout dell'ultimo tag sul repository rabbitmq-c.asph –

2

Questo perché il tuo rabbitmq è più vecchio della versione richiesta dall'estensione php.

È possibile installare la versione più recente di RabbitMQ o versione inferiore del prolungamento come:

pecl install amqp-1.2.0 

Ma penso che con le versioni più recenti è la scelta migliore.

+1

bel suggerimento! È Werd ma solo la versione 1.6.beta ha funzionato per me ubuntu 14/PHP 5.6 –

3

questo è quello che ho fatto installare con successo su debian ansimante:

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 
+0

Questo ha funzionato per me quando tutte le altre soluzioni non sono riuscite (errori di compilazione a bizzeffe). Grazie! –

3

Questo è quello che ho fatto installare con successo su debian ansimante: ho dovuto usare la versione 0.5.2 di RabbitMQ-c

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 
1

Installazione di AMQP di rabbitmq con pecl con PHP7.0

Basta seguire alcuni passaggi per installare tutte le sue dipendenze e la libreria amqp. Funziona per me con bento/ubuntu-16.04 con php7.0

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 e le sue dipendenze di versioni diverse può essere scaricato da

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